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

I have no clue if such tool exists and if it exists, how it's called but I'm looking for an abstraction layer above a HTTP proxy.

Currently I'm working as a consultant at a few companies and all of them use a proxy. It's really a configuration hell if I have to reconfigure all proxies (some are using the system proxy but some can't) every time I switch from company to company.

So I'm looking for a tool, for example a localhost "proxy daemon" or how it's called so I just configure all tools to use that localhost HTTP proxy and I only have to configure that localhost proxy to use the correct company proxy. It would save a lot of time since I only have to configure it once.

It would even be greater if the tool could automatically poll all proxy servers and choose the correct proxy server depending on the available proxy servers.

I'm using Ubuntu, so it might even be harder to find such a tool.

So my question is, are there such tools? How do you call such a tool? Any suggestions?

share|improve this question
up vote 1 down vote accepted

You are actually asking two questions. One is about the proxy and the other is about switching configs depending on ip address change.

The first: The popular squid proxy and caching server can be configured to use an upstream proxy. cache_peer option is probably what you need. You might also want to adjust memory and on-disk cache values to avoid caching locally. You should check ACL/ip listening/firewall rules to make sure only your laptop can access it.

The second: You can write a script that checks the ip address and switch between above squid configuration according to your needs. You can trigger the script launch with the package "ifupdown". You can read documention and examples on how to use ifupdown from /usr/share/doc/ifupdown directory on your Ubuntu.

share|improve this answer
Polipo might be better than Squid in this case; it's smaller and easier to set up. – user235731 Jul 9 '13 at 11:46
Thanks, I tried squid and it really works as expected (I also tried polipo which was indeed smaller to setup). I didn't find out if I could save default authentication details or not, but it helps me a lot already. – g00glen00b Jul 12 '13 at 12:25

I believe proxydriver does what you are looking for.

Alternatively, if you are only working from a terminal, you could write a simple shell script that takes a network name as an argument and sets the http_proxy environment variable appropriately:

case $1 in
    network1) export http_proxy= ;;
    network2) export http_proxy= ;;
    *) export http_proxy=
share|improve this answer
True, but the problem is that that doesn't work everywhere. Apt uses apt.conf as far as I know, I'm using the Opera browser sometimes which uses it's own proxy settings (and there are probably a few others that also use their own configuration). I'm going to look at proxydriver later today, but thanks already. – g00glen00b Jul 9 '13 at 11:38
proxydriver was really interesting, especially because I could connect my proxy settings to a network interface. Only annoying thing is that I often use the wired connection and you can only define one configuration for this interface (logically). – g00glen00b Jul 12 '13 at 12:24

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.