Could Onebox Support URL Retrieval via Proxy

(Steven Arnott) #1

Our discourse installation is tightly locked down so it’s not possible for the OneBox to reach out from the server to an external website to provide a preview.

There is a proxy server that it go via. How can OneBox be told to retrieve the URL via a proxy host?

(Michael Downey) #2

I don’t know the answer, but it sounds like you’ll also have trouble updating the Docker image through the admin UI, too.

(Sam Saffron) #3

You would need to submit a PR for this, there is no built in way of doing this, we assume servers have access to the Internet.

(Steven Arnott) #4

As I’m not a ruby coder, I would have no idea where to start on adding proxy support.

(Kevin P. Fleming) #5

I suspect the underlying HTTP/HTTPS library being used has configuration options for proxy usage, it would mostly be a matter of figuring out what they are and then finding a good place to store them (in the container config, or through the admin interface, or some other place).

(Steven Arnott) #6

So far I see the following libraries:

Net::HTTP (Onebox.Helper.fetch_response)

Nokogiri::HTML (Onebox.Engine.HTML ‘raw’)

MultiJson.load (Onebox.Engine.JSON ‘raw’)

According to class Net::HTTP - Documentation for Ruby 2.0.0 http_proxy env should work

(James) #7

Apologies for necroing this old thread… I couldn’t find anything else on topic that is newer.
Did this get resolved? I’m in the same situation with a discourse instance that only has internet access via a proxy server.
My app.yml defines the necessary http_proxy and https_proxy env vars, and these are respected for some actions (e.g. during install) but not for onebox retrieval.

(Alexander “Weej” Jones) #8

We’re also having the same problem. We have http_proxy, HTTP_PROXY, https_proxy and HTTPS_PROXY defined. As far as I know the proxy is allowing access to e.g. Twitter.

Does this onebox plugin need to talk to a specific web site or does it go directly to e.g. Twitter?


Does anyone know if v2 will resolve this?