Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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
1  
Polipo might be better than Squid in this case; it's smaller and easier to set up. –  Brandon Invergo 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. –  Dimitri M 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:

#!/bin/bash
case $1 in
    network1) export http_proxy=http://proxy.company1.com ;;
    network2) export http_proxy=http://proxy.company2.com ;;
    *) export http_proxy=
esac
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. –  Dimitri M 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). –  Dimitri M Jul 12 '13 at 12:24

Your Answer

 
discard

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.