Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Disclaimer: I can't test ATM which is why I'm asking. My OS is Debian Lenny.

I'm behind the intranet sometimes and have to configure proxy settings manually for a whole slew of applications. I've actually seen some dialog/option with 'Gnome Proxy Settings' and some applications let you specify this. I'm wondering if changing those would globally reroute any requests on * ports to a specified proxy?

And would those include ports accessed through things such as php/python which I believe use C internally to open sockets?

share|improve this question

No, changing them won't affect every program, only those that respect them. The http_proxy environment variable is respected by most programs, but setting it for PHP is pretty hard. You could use iptables to redirect all port 80 traffic to go through the proxy, but unless it's configured to be a transparent proxy, that won't work.

Running a local squid as a transparent proxy and telling it to use the other proxy would work - see the Squid wiki for more details on the iptables and squid.conf changes required.

share|improve this answer

Seems time to mention DeleGate again. :-)

Not to be preferred if you can fix it some other way. (And I assume @TRS-80's answer will work). But if all else fails, then you could change your hosts file to map the domains that do not honour your proxy settings to localhost. Next, on localhost run DeleGate to pass those to the actual server, using the proxy server (if any) applicable for that location.

As this is kind of a man-in-the-middle attack, this will not work for SSL/HTTPS though, unless you can accept security warnings.

See Force web address to go through https, which for your HTTP-to-HTTP-using-proxy gateway would be something like (not tested):

sudo ./debian3-dg -v -P80,443 \
  SERVER=http \
  RELAY=vhost \
  RESOLV=cache,dns \
  STLS=-fcl,-fsv \ \
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.