I have an HTTP and HTTPS proxy at my work. Though when I work from home (on the laptop from work) I would like to disable the proxy settings (connect directly to the Internet). Then, when I come back to work, bring back the proxy settings.
The problem is, only a few application recognize the system-wide proxy settings (set using the Linux Mint's network manager and through HTTPS_PROXY
and HTTP_PROXY
environment variables). For many other applications (IntelliJ, SBT, Maven, Synaptic, apt-get, git) I had to set them manually and editing the settings for each of them every time is tedious.
I could probably write a script or something that would edit settings files of all those applications, but I think it's error-prone (I could corrupt the files) and not really the easiest solution. What I thought about is intercepting the outgoing packets sent to the proxy, repackaging them somehow and sending them directly to the Internet. Would it be possible to do that using an iptables rule or something similar? I'm not really an expert when it comes to networks, proxies, etc. so I'm not even sure if it's doable, not to mention constructing the rule myself. Would be grateful for your help!