# Working on localhost, not on Network

**URL:** <https://discourse.haproxy.org/t/working-on-localhost-not-on-network/1619>\
**Category:** Help!\
**Created:** [September 28, 2017, 10:34pm UTC](https://discourse.haproxy.org/t/working-on-localhost-not-on-network/1619 "2017-09-28T22:34:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jared.dembrun](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jared.dembrun](https://discourse.haproxy.org/u/jared.dembrun)\
**Post date:** [September 28, 2017, 10:34pm UTC](https://discourse.haproxy.org/t/working-on-localhost-not-on-network/1619/1 "2017-09-28T22:34:11Z")

</div>

I have a basic haproxy running on my machine just trying to forward any traffic to a web server running on the same machine (port 9000). This works correctly on localhost, but not for any other devices. I have tried to connect via netcat and a browser on three different networks. The connection always times out (but is not refused like it is for other ports). Nmapping the port from the machine running haproxy shows it is open, shows it is ‘filtered’ in scans from other devices.

The configuration file is a trimmed version of the one on [this page](https://www.javacodegeeks.com/2013/08/haproxy-up-and-running-in-couple-of-minutes.html). Looks like this:

defaults  
&nbsp;&nbsp; mode http  
&nbsp;&nbsp; timeout connect 10000ms  
&nbsp;&nbsp; timeout client 50000ms  
&nbsp;&nbsp; timeout server 50000ms

frontend http-in  
&nbsp;&nbsp; bind \*:9050  
&nbsp;&nbsp; default\_backend websockets\_support

backend websockets\_support  
&nbsp;&nbsp; server ws1 127.0.0.1:9000

This is a work computer (mac) with certain security configurations. I am going to try running a similar proxy on my own linux machine when I get home tonight. In the meantime, if anyone else has dealt with this problem, I would appreciate some help. I am doubtful that it is security configurations since there is not a connection refused, just a timeout.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [September 29, 2017, 7:45am UTC](https://discourse.haproxy.org/t/working-on-localhost-not-on-network/1619/2 "2017-09-29T07:45:40Z")

</div>

Its the security configuration, for sure. Haproxy is correctly configured to serve traffic from all sources.

> [@jared.dembrun](#):
>
> I am doubtful that it is security configurations since there is not a connection refused, just a timeout.

The opposite is true, most iptables configurations DROP the packet instead of REJECTing the connection attempt, leading to a timeout on the client.

---

<div class="post-metadata">

**Author:** ![jared.dembrun](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jared.dembrun](https://discourse.haproxy.org/u/jared.dembrun)\
**Post date:** [September 29, 2017, 2:44pm UTC](https://discourse.haproxy.org/t/working-on-localhost-not-on-network/1619/3 "2017-09-29T14:44:03Z")

</div>

After my testing last night on my linux machine at home, I am 99% certain you are right. This is a problem with the particular device.

---

<div class="post-metadata">

**Author:** ![jared.dembrun](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jared.dembrun](https://discourse.haproxy.org/u/jared.dembrun)\
**Post date:** [October 11, 2017, 5:44pm UTC](https://discourse.haproxy.org/t/working-on-localhost-not-on-network/1619/4 "2017-10-11T17:44:23Z")

</div>

Just to answer the question more fully, I found that switching binding to port 2000 resolved the problem. It seems like port 9050 isn’t allowed to receive incoming connections by some rules on the machine itself somewhere. If you’re having a similar problem, try a bunch of different ports.
