Proxy settings

We have laptop users in the office here that use a proxy server, when they take their laptop home they need it off, anyway to do this automatically without creating batch files or files to modify the registry. Thanks
Who is Participating?
Jbirk1Connect With a Mentor Commented:
You can do this with a proxy.pac file.

Something like this:

proxy_yes is the IP and port of yoru proxy server.  Each of those websites in the if statements say return the proxy_no for websites you want to bypass the proxy.

After the special circumstances, you check if the laptop is on your LAN/WAN at work.  If it is on the yoru network, return the PROXY server IP.  If it is not on your work network, return DIRECT.  It checks to see if it is on the network in this example.  Obviously, you need to make this work with your work's subnet.

Now, save this as a text file called proxy.pac not proxy.txt or anything like that.  Now, you put this on your companies website in a location where it can be downloaded from anywhere.  I.e.

Now you setup Internet Explorer or another browser to use this .pac file.

Tools, Internet Options, Connections Tab, LAN Settings, CHECK "Use Automatic Proxy Configureation Script" and put in the URL to the proxy.pac file.

You can also do automatic proxy configureation, but that is more challenging.  Basically you have to setup DHCP or WPAD and DNS to do that.  I suggest you just do the automatic proxy config.

function FindProxyForURL(url, host)
// variable strings to return
var proxy_yes = "PROXY";
var proxy_no = "DIRECT";
if (shExpMatch(url, "*")) { return proxy_no; }
if (shExpMatch(url, "*")) { return proxy_no; }
if (shExpMatch(url, "*")) { return proxy_no; }
if (shExpMatch(url, "*")) { return proxy_no; }
// Proxy if PC is on local LAN
if (isInNet(myIpAddress(), "", ""))
return "PROXY";
return "DIRECT";

YOu can find all of the information you need here.


Hi tollair,

not without a file, the proxy should get bypassed at home anyway if the auto detect button is enabled
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.