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
tollairAsked:
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 192.168.1.0/255.255.255.0 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. http://www.mycompany.com/proxy.pac

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 192.168.1.1:8080";
var proxy_no = "DIRECT";
if (shExpMatch(url, "http://www.mycompanywebsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://www.myotherwebsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://www.my3rdlocalsite.com*")) { return proxy_no; }
if (shExpMatch(url, "http://192.168.1.100*")) { return proxy_no; }
// Proxy if PC is on local LAN
if (isInNet(myIpAddress(), "192.168.1.0", "255.255.255.0"))
return "PROXY 192.168.1.1:8080";
else
return "DIRECT";
}


YOu can find all of the information you need here.

Thanks

http://nscsysop.hypermart.net/proxypac.html


Justin
0
 
Jay_Jay70Commented:
Hi tollair,

not without a file, the proxy should get bypassed at home anyway if the auto detect button is enabled
0
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.