I am working on a project where my software is trying to connect a server running in public domain on some unusual port. ( I have set this server in public domain myself ). My corporate firewall does not allow me to connect to this server on this unusual port. So I have configured web proxy on the same machine where my server is running (i.e web proxy and my server both have same IP address), with the hope I will use this web proxy to access blocked port from my corporate network.

Now the problem is, my web-proxy does allow me to access everything else (i.e It is providing me anonymity very well) but when I try to access the server (which is running on the same IP address), I am unable to access it via web-proxy. I have allowed just my corporate IP address in the web-proxy to allow access and deny everyone else. Give is the configuration of Squid.

acl cspnet src A.B.C.D/32
http_access allow cspnet

# And finally deny all other access to this proxy
http_access deny all

http_port 8080

coredump_dir /usr/local/squid/var/cache/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

I don't want to configure Squid to work as accelerator for my server, I just want to access the unusual port of my server from my client from my corporate network. A.B.C.D is also the IP address where my server is running. I have also tried things like

acl safe_port port X
http_access allow localhost

But nothing seems to work. The same server is running on another IP address in public domain (which I have set-up), and with my web-proxy (which I have configured above) I can access that server (which is bind to a different IP address) from my corporate network, but not this one which lies on the same IP address. Any thoughts ?

Here is some more information. The client software which is trying to connect to my server is running on a console based (no interface available) embedded linux box. I think usage of SSH Tunnels will require me to first login via SSH tunnel (using some SSH client - i.e Putty) on the box and then I can run my client software. Secondly I can add support in my box software to login via SSH Tunnels but I don't want to waste time on this effort. I am not sure if connecting with SSH Tunnels can be seamless so I think the better solution is just to configure my linux box to use web proxy as system network configuration so that all network access are made via web proxy.

Ok. I have tried removing everything from the squid.conf and just left

http_access allow all

I am still not able to access to the server running on the localhost. That means problem is not in the squid.conf, I need to add something else somewhere to allow access of the server running on localhost via squid.

Ok. Another test. I also have a webserver (apachi) running on my server machine. Via web-proxy when I have tried to access my webserver, I have got my page. That (I believe) confirms the problem lies somewhere in my server which I am trying to access or not ? The server I am trying to access is listening on 9000 port.

  • Curious: Assuming this is a project the company is having you work on, why don't they change the firewall configuration to allow it? I hope you've tried this approach first...
    – derobert
    Commented Feb 11, 2013 at 15:05
  • (1) does the server you're trying to access accept connections from localhost? Or is its listen socket bound only to the public IP? (2) clarify "I am unable to access it via web-proxy"—do you get an error back from squid? Which error? Check the three squid logs, anything?
    – derobert
    Commented Feb 11, 2013 at 15:07
  • Also, for what you're doing, you may want to just use a iptables nat rule to make the server available on a second port as well. Or use ssh port forwarding. Squid is a pretty heavyweight solution.
    – derobert
    Commented Feb 11, 2013 at 15:08
  • Yes, this was the first thing I have tried but as per my company firewall policy it will take years to have my ports open. Also they have given me some sort of tunnelling procedure to access ports which I am trying to but as I have mentioned in Update # 1, this procedure seems lengthy to me. Commented Feb 12, 2013 at 6:42
  • 1) Yes, the server is bind to all available instances on the localhost. Commented Feb 12, 2013 at 6:50

1 Answer 1


Ok. The problem was at my end. I was testing Firefox for the connectivity with my server via web proxy, and I just need to select "Use this proxy server for all protocols" in the Firefox Proxy selection settings, and after this selection I am able to access my server via Firefox.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .