Link to home
Start Free TrialLog in
Avatar of tezza80
tezza80

asked on

how to edit proxy.pac file

Hi... I have a proxy.pac file that gets applied through group policy so that if users from our office use the internet it goes through our proxy server, but if they are outside our network than the connection is direct. I want to modify this file so that it applies for all our other offices throughout the country. The file currently is as follows:

function FindProxyForURL(url,host)
{
if(isInNet(myIpAddress(),"10.21.1.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
else
return "DIRECT";
}

I tried to modify it myself, but it doesn't work, as I don't really know the write syntax or what language it even is. But from my attempt, you should be able to see what I'm trying to achieve:

function FindProxyForURL(url,host)
{
if(isInNet(myIpAddress(),"10.21.1.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
or
if(isInNet(myIpAddress(),"10.21.2.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
or
if(isInNet(myIpAddress(),"10.21.3.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
or
if(isInNet(myIpAddress(),"10.21.4.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
or
if(isInNet(myIpAddress(),"10.21.5.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
or
if(isInNet(myIpAddress(),"10.21.6.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
or
if(isInNet(myIpAddress(),"10.21.9.0","255.255.255.0"))
return "PROXY 10.21.1.32:8080";
else
return "DIRECT";
}

any assistance would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of purplepomegranite
purplepomegranite
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not a form of JavaScript, it is a JavaScript function!
Avatar of tezza80
tezza80

ASKER

Thanks for your help. I tested it out on a remote laptop and it worked.