V
V
Vyacheslav Makodin2014-04-26 01:14:10
System administration
Vyacheslav Makodin, 2014-04-26 01:14:10

How to set up a pac-file to automatically change the proxy to a backup when there is no connection on the main one?

There are 2 proxy servers in the network:

  • transparent ( Provider1 )
  • opaque ( Provider2 ) at 10.10.1.141:8080.

You need to configure the pac file in such a way that if Provider2 or the non-transparent proxy itself is not available, the connection goes through the transparent proxy to Provider1 .
I tried this configuration - it does not work:
function FindProxyForURL(url, host)
 {
 if (isResolvable(host))
 return "PROXY 10.10.1.141:8080";
 else
 return "DIRECT";
 }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Makodin, 2014-04-29
@noakky

Decided like this:

function FindProxyForURL(url, host) {
return "PROXY 10.10.1.4:8080; PROXY 10.10.1.141:8080; DIRECT";
}

I
Ingtar, 2014-04-26
@Ingtar

The simplest thing that came to my mind is to generate it with a script on the server where this file is located.
In the script, specify a check that if a certain site is not accessible from the outside through one proxy - substitute it in return "PROXY $PROXY_ADDR:8080"; second address.
I think the pac file itself does not have such a check.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question