0

I have a server that ordinarily does not require a proxy to connect (e.g.) to any URL on the internet. However some specific systems (IP addresses) I need to connect to via a specific proxy.

My question is how I can specify the proxy per IP-Address / subnet without disrupting the normal configuration where no proxy is required.

I am aware of the following variables that can be set, however this operates on an exclusion basis to access the proxy rather than an inclusion basis:

export http_proxy=http://my-proxy.tld:8080
export https_proxy=https://my-proxy.tld:8080
export no_proxy=127.0.0.1,localhost,192.168.1.123, ...

The server in question is a RedHat V7.1 box.

Any ideas will be much appreciated. Thanks in advance Alex

lintal
  • 121
  • 1
  • 4
  • What are the nature of the applications you're talking about? One-shot CLI utilities? Long-running daemons? Etc.? If long-running daemons, how are the services being started? – EEAA Sep 09 '15 at 16:43
  • These are daemons which are running, so long-running services. They have been started using systemctl. For example, a LAMP stack is in use amongst other services. – lintal Sep 10 '15 at 10:44

1 Answers1

1

You can use Squid. If you want a smaller footprint installation and smaller configuration files, you could also try Tinyproxy.

Enzo Wang
  • 121
  • 2
  • Interesting, yes. I was hoping for a solution available within the OS without the need to run a proxy-server on the same box. – lintal Sep 10 '15 at 10:46
  • you could run the `http_proxy=xy | abc` which should only set it for this command – djdomi May 27 '21 at 20:08
  • additional I've found https://unix.stackexchange.com/questions/23452/set-a-network-range-in-the-no-proxy-environment-variable – djdomi May 27 '21 at 20:09