Could Onebox Support URL Retrieval via Proxy

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?

1 Like

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

1 Like

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.

1 Like

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

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).

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 http://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html http_proxy env should work

1 Like

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.

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?

Worth looking at
https://meta.discourse.org/t/onebox-assistant-crawl-for-those-previews-reliably/107405/35

1 Like