# Could Onebox Support URL Retrieval via Proxy

**URL:** https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935
**Category:** Support
**Created:** [9 Julho , 2015 20:12 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935 "2015-07-09T20:12:03Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Steven\_Arnott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven_arnott/32/42737_2.png) [@Steven\_Arnott](https://meta.discourse.org/u/Steven_Arnott)
#### Post date: [9 Julho , 2015 20:12 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/1 "2015-07-09T20:12:03Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [9 Julho , 2015 20:17 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/2 "2015-07-09T20:17:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [9 Julho , 2015 21:31 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/3 "2015-07-09T21:31:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Steven\_Arnott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven_arnott/32/42737_2.png) [@Steven\_Arnott](https://meta.discourse.org/u/Steven_Arnott)
#### Post date: [10 Julho , 2015 14:46 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/4 "2015-07-10T14:46:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)
#### Post date: [10 Julho , 2015 14:57 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/5 "2015-07-10T14:57:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Steven\_Arnott](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven_arnott/32/42737_2.png) [@Steven\_Arnott](https://meta.discourse.org/u/Steven_Arnott)
#### Post date: [10 Julho , 2015 15:28 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/6 "2015-07-10T15:28:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jimbob](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jimbob](https://meta.discourse.org/u/jimbob)
#### Post date: [20 Julho , 2017 11:18 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/7 "2017-07-20T11:18:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![alexweej](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexweej/32/120813_2.png) [@alexweej](https://meta.discourse.org/u/alexweej)
#### Post date: [4 Agosto , 2017 10:40 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/8 "2017-08-04T10:40:34Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![SharonK](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@SharonK](https://meta.discourse.org/u/SharonK)
#### Post date: [21 Maio , 2018 10:46 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/9 "2018-05-21T10:46:37Z")

</div>

Does anyone know if v2 will resolve this?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [8 Novembro , 2020 05:05 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/10 "2020-11-08T05:05:02Z")

</div>



---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [8 Novembro , 2020 08:46 UTC](https://meta.discourse.org/t/could-onebox-support-url-retrieval-via-proxy/30935/11 "2020-11-08T08:46:47Z")

</div>

Vale a pena conferir  
[https://meta.discourse.org/t/onebox-assistant-crawl-for-those-previews-reliably/107405/35](https://meta.discourse.org/t/onebox-assistant-crawl-for-those-previews-reliably/107405/35)
