# Proxy Server for HTTP Binding

**URL:** <https://community.openhab.org/t/proxy-server-for-http-binding/37293>\
**Category:** Bindings\
**Tags:** httpbinding1, proxy\
**Created:** [December 14, 2017, 12:57pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293 "2017-12-14T12:57:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBurch](https://community.openhab.org/letter_avatar_proxy/v4/letter/g/9de0a6/32.png) [@GBurch](https://community.openhab.org/u/GBurch)\
**Post date:** [December 14, 2017, 12:57pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293/1 "2017-12-14T12:57:05Z")

</div>

Hi All,

I’m quite new to OpenHAB, and haven’t quite got my head around it completely yet, so please bear with if this seems a little ‘basic’.

I have the Weather Binding (binding-weather1 - 1.10.0) installed in OpenHAB 2.1.0 release build. However, it seems to be trying to make outbound HTTP connections directly, rather than through the proxy server:

```
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)[58:org.apache.servicemix.bundles.commons-httpclient:3.1.0.7]

```

from opanhab.log file, as well as the attempted connections seen on the Firewall.

Where do I configure the proxy settings in the Apache HTTP Client? I’ve previously had to configure proxy settings somewhere else to allow me to download bindings and addons (although, I can’t remember exactly where I did this!), but presumably binding needs it to be configured somewhere else. Will I have to configure proxy settings for other bindings I install that need Internet access as well?

Many thanks

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [December 14, 2017, 7:27pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293/2 "2017-12-14T19:27:33Z")

</div>

This is a really good question I do not have the answer for.

This is an old thread but the solutions discussed might apply.

> [@Set up HTTP Bindings when openHAB runs behind a HTTP proxy](https://community.openhab.org/t/set-up-http-bindings-when-openhab-runs-behind-a-http-proxy/11813):
>
> Hi community, I try to get openHAB working on a linux box in a network which must use a HTTP proxy to connect to the Internet. When I once started with “openHAB 1.8.3 demo master” for example the YahooWeatherBinding always failed with: [ERROR] [o.o.b.w.i.scheduler.WeatherJob] - query.yahooapis.com java.net.UnknownHostException: query.yahooapis.com When I used the web browser instead to GET sth. from this URL I received some data. The browser uses no special HTTP proxy settings but the sys…

---

<div class="post-metadata">

**Author:** ![GBurch](https://community.openhab.org/letter_avatar_proxy/v4/letter/g/9de0a6/32.png) [@GBurch](https://community.openhab.org/u/GBurch)\
**Post date:** [December 20, 2017, 1:08pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293/3 "2017-12-20T13:08:04Z")

</div>

Thanks for pointing me in this direction, however, it doesn’t seem to have made any difference.

To clarify further: I’m running as a service under Windows Server 2012 R2 Server Core. I’ve now managed to get into the console (after figuring out that SSH connections are limited to localhost by default). Is there something from the console that allows me to view/set the proxy, or to test it without waiting for one of my tasks to trigger?

At what level should the proxy be set? It’s set at the OS level, does it also need to be set at Java? Keraf? Per Binding?

Many thanks

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [December 20, 2017, 6:30pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293/4 "2017-12-20T18:30:09Z")

</div>

> [@GBurch](#):
>
> Is there something from the console that allows me to view/set the proxy, or to test it without waiting for one of my tasks to trigger?

I don’t think so. Based on my very very old experience with Java and proxies it is something that needs to be set at the Java level. And it is usually set in the parameters passed to java when you run a program, or through environment variables.

Because the system level setting is a Windows only thing, most cross-platform languages like Java and Python cannot use it and need to be told about the proxy through some other way.

---

<div class="post-metadata">

**Author:** ![GBurch](https://community.openhab.org/letter_avatar_proxy/v4/letter/g/9de0a6/32.png) [@GBurch](https://community.openhab.org/u/GBurch)\
**Post date:** [December 21, 2017, 12:55pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293/5 "2017-12-21T12:55:31Z")

</div>

> And it is usually set in the parameters passed to java when you run a program, or through environment variables

So, where would this be set in a Windows system, running OpenHAB as a service?

I’ve set the -Dhttp\*.proxy\* variables in /userdata/etc/openHAB-wrapper.conf and /runtime/bin/setenv.bat

I’ve also configured proxy details in userdata/config/settings.xml

Yet, the only connections to the proxy from the OpenHAB server’s IP address are OS initiated connections. Have I missed something?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [December 21, 2017, 5:39pm UTC](https://community.openhab.org/t/proxy-server-for-http-binding/37293/6 "2017-12-21T17:39:47Z")

</div>

I don’t know because I don’t know what .bat file is called when Windows starts the service. If it skips the wrapper and settings and just launches Java directly then those settings would not be picked up.
