none
Internet -> Lan Settings -> Pac File

    Question

  • I am trying to configure a proxy.pac file for testing. I've  boiled it down to the most simple config and it still doesn't work.

    I am using a non domain-member WMWare Fusion VM connected with one active network connection bridge to a wired nic.

    Windows8/IE10

    I created a local share on the machine called: \\testvm\proxy and place my proxy.pac file in there.

    The pac file contains just this:

    function FindProxyForURL(url, host) {
     
    if ( url == "www.google.com" ) {
             return "PROXY 10.10.10.10";
    }
    else {
    	return  "DIRECT";
    }
    
    }
    

    The 10.10.10.10 machine does not exist.

    I registered the pac file in IE using these settings:

    [Unticked] Automatically detect settings

    [Ticked] Use automatic configuration script

    Address: \\testvm\proxy\proxy.pac

    [Unticked] Use a proxy server for your LAN

    I would expect IE to time out when I try to access www.google.com, but succeed for www.bing.com

    However both urls work.

    What have I done wrong?

    Thursday, January 03, 2013 6:41 PM

Answers

  • I have configured the IE Properties -> Connections -> LAN Settings to have:
    - [Unticked] Automatically detect settings
    - [Ticked] Use automatic configuration script
    - Address: file:////c:/pac/proxy.pac
    - [Unticked] Use a proxy server for your LAN

    maybe try:
    file://c:/pac/proxy.pac

    I've never been totally %100 on the "correct" syntax, when it's a local file rather than via UNC


    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    • Marked as answer by dmw-asdfghjkl Monday, January 07, 2013 6:22 PM
    Saturday, January 05, 2013 5:23 AM

All replies

  • I created a local share on the machine called: \\testvm\proxy and place my proxy.pac file in there.

    Address: \\testvm\proxy\proxy.pac

    the syntax needs to be a little different. You're using UNC and it needs to be compliant with URI/URL.

    if the PAC file is hosted on the local machine itself, you need something like this:

    file:////testvm/proxy/proxy.pac

    check here: http://techblog.mirabito.net.au/?tag=pac-file


    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Thursday, January 03, 2013 8:55 PM
  • Thanks.

    I have it set up as described (I had thought the four /'s were a typo).

    I am still able to access the pages I should not be able to access. If there is no proxy defined at 10.10.10.10 is does not just fail to DIRECT does it?

    IS the fact that I have not specified a port a problem?

    Thursday, January 03, 2013 10:02 PM
  • some more references for you, John LoVerso's no-ads.pac looks like it might be what you want to read up on..

    http://www.proxypacfiles.com/proxypac/index.php?option=com_weblinks&view=category&id=34%3Aother-pac-file-guides-and-documentation&Itemid=98

    http://www.schooner.com/~loverso/no-ads/


    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Thursday, January 03, 2013 11:15 PM
  • Thanks.

    As far as I can tell those sites (& most things I have found on the internets) help me write and validate the pac file, my pac file is super-simple so I know it 'works', the problem is that Windows/IE10 do not appear to use the file and I don't know how to confirm or log this?

    Friday, January 04, 2013 9:11 PM
  • you should be able to use wireshark or netmon or fiddler to examine the outbound packets/requests/responses.
    but it may be that the TCP/IP stack is returning something like "no route to host" for the 10.10.10.10 destination.
    John LoVerso's guide talks a little bit more about the browser settings needed to get blackholeproxyserver working: http://www.schooner.com/~loverso/no-ads/#howwork

    I've dabbled with PAC files a long time ago, but not with blackholeproxyserver setups.
    It seems you may need a little bit more than just the PAC file itself.
    And, things may have changed (just a guess) under Win8/IE10 ?


    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    • Proposed as answer by Himanshu12221 Saturday, January 05, 2013 12:51 AM
    Friday, January 04, 2013 10:55 PM
  • I must be doing something wrong -- no idea what.

    (incidentally is this the most useless KB ever: http://support.microsoft.com/kb/278356)

    I have reverted to an XP/IE8 VM.

    First I tried: IE Properties -> Connections -> LAN Settings to have
    - [Unticked] Automatically detect settings
    - [Unticked] Use automatic configuration script
    - [Ticked] Use a proxy server for your LAN
    - Address: 192.168.8.141
    - Port: 8888

    I have the other Win8 machine running on 192.168.8.141. On this machine fiddler is running, listening on port 8888 so it really works as a proxy.
    When I browse anywhere on the XP machine I see the traffic pass though the Fiddler proxy on the Win8 machine.
    Great!


    So now to test t with the pac.


    I have configured the IE Properties -> Connections -> LAN Settings to have:
    - [Unticked] Automatically detect settings
    - [Ticked] Use automatic configuration script
    - Address: file:////c:/pac/proxy.pac
    - [Unticked] Use a proxy server for your LAN

    The pac file now contains:
    --
    function FindProxyForURL(url, host)
    {
        return "PROXY 192.168.8.141:8888";
    }
    --

    I would expect this to behave in the same way as the original config, but, No, the traffic goes direct to the internet, skipping the proxy config.



    Saturday, January 05, 2013 12:17 AM
  • I have configured the IE Properties -> Connections -> LAN Settings to have:
    - [Unticked] Automatically detect settings
    - [Ticked] Use automatic configuration script
    - Address: file:////c:/pac/proxy.pac
    - [Unticked] Use a proxy server for your LAN

    maybe try:
    file://c:/pac/proxy.pac

    I've never been totally %100 on the "correct" syntax, when it's a local file rather than via UNC


    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    • Marked as answer by dmw-asdfghjkl Monday, January 07, 2013 6:22 PM
    Saturday, January 05, 2013 5:23 AM
  • I have configured the IE Properties -> Connections -> LAN Settings to have:
    - [Unticked] Automatically detect settings
    - [Ticked] Use automatic configuration script
    - Address: file:////c:/pac/proxy.pac
    - [Unticked] Use a proxy server for your LAN

    maybe try:
    file://c:/pac/proxy.pac

    I've never been totally %100 on the "correct" syntax, when it's a local file rather than via UNC


    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

    Now you can be 100% -- you need just two slashes.

    Combination of the setup above and the super-simple pac file is working for me on my XP machine - it will do.

    Thanks

    Monday, January 07, 2013 6:24 PM