Proxy settings

Posted on 2006-05-29
Last Modified: 2012-08-14
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
Question by:tollair
    LVL 48

    Expert Comment

    Hi tollair,

    not without a file, the proxy should get bypassed at home anyway if the auto detect button is enabled
    LVL 3

    Accepted Solution

    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.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
    We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now