+ Post New Thread
Results 1 to 5 of 5
Internet Related/Filtering/Firewall Thread, Proxy .pac file in Technical; Hi, If you set the proxy settings in IE using a .pac file. Is it possible to make it so ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,942
    Thank Post
    886
    Thanked 1,694 Times in 1,472 Posts
    Blog Entries
    12
    Rep Power
    447

    Proxy .pac file

    Hi,

    If you set the proxy settings in IE using a .pac file. Is it possible to make it so all sites go through the default gateway, but then sites listed in the file for them to go via a proxy server?

    Bit of an odd request i know...

    Thanks

  2. #2
    fawkers's Avatar
    Join Date
    Jun 2007
    Location
    Southend
    Posts
    193
    Thank Post
    32
    Thanked 22 Times in 21 Posts
    Blog Entries
    2
    Rep Power
    31
    This is my PAC file

    Code:
    function FindProxyForURL(url, host)
    {
    if ((host == "172.16.100.102") || (host == "172.16.127.200") || (host == "172.16.100.34")) || (host == "172.16.100.194")
    return "Direct";
    if (isInNet(myIpAddress(), "172.16.64.0", "255.255.255.0"))
    return "PROXY 10.142.34.33:8084";
    else
    return "DIRECT";
    }
    basicly if i try to reach any of the IP address on the top line i'll go direct via the default gatway,

    if (isInNet(myIpAddress(), "172.16.64.0", "255.255.255.0")) looks if im in that subnet and if so will you the proxy given, else it goes throught the Default gateway.

    so yours should look something like

    Code:
    function FindProxyForURL(url, host)
    {
    if ((host == "172.16.100.102") || (host == "172.16.127.200") || (host == "172.16.100.34")) || (host == "172.16.100.194")
    return "PROXY 10.142.34.33:8084";
    else
    return "DIRECT";

  3. Thanks to fawkers from:

    FN-GM (9th February 2010)

  4. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,942
    Thank Post
    886
    Thanked 1,694 Times in 1,472 Posts
    Blog Entries
    12
    Rep Power
    447
    Thanks.

    What code would i need to put each IP address or website address on each line. It will make things a little easier when you review it you see.

  5. #4
    fawkers's Avatar
    Join Date
    Jun 2007
    Location
    Southend
    Posts
    193
    Thank Post
    32
    Thanked 22 Times in 21 Posts
    Blog Entries
    2
    Rep Power
    31
    just offmy head im not sure (will have to check) but i think that PAC files ignore white space so you might just be able to put a carrage return in.

  6. #5
    CensorNet's Avatar
    Join Date
    Aug 2007
    Location
    Bristol, UK
    Posts
    11
    Thank Post
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    15
    Hi,

    If you want to match specific sites (URL's) you will need to use shExpMatch to match the domain and path.

    Just off the top of my head, a wpad.dat file to do what you ask would look like this (replace 10.0.41.15:8080 with your proxy IP and port):

    Code:
    function FindProxyForURL(url, host)
    {
    
      // Add hostname exceptions for sites you do want to proxy
      // First line is a normal web site
      // Second line is a HTTPS or site with a different port number other than 80
    
      if(shExpMatch(url,"*.proxythis.com/*")) { return "PROXY 10.0.41.15:8080"; }
      if(shExpMatch(url,"*.proxythis.com:*/*")) { return "PROXY 10.0.41.15:8080"; }
    
      // If no matches found, use default route
    
      return "DIRECT";
    }
    I should also point out that in some versions of Internet Explorer the browser will try and go direct to the Internet even if you tell it not to by checking "Automatically detect network settings". The only way to force it to use the WPAD file is to firewall off port 80 and 443 unless it comes from the proxy IP, but this of course would defeat the object of what you want your WPAD file to do.

    I am not sure if these bugs have been fixed in later versions of IE.

    Good luck

  7. Thanks to CensorNet from:

    mark (10th February 2010)

SHARE:
+ Post New Thread

Similar Threads

  1. .pac file problem
    By mrbios in forum Scripts
    Replies: 3
    Last Post: 16th October 2009, 11:28 AM
  2. proxy .pac file
    By sted in forum Windows
    Replies: 12
    Last Post: 24th September 2009, 07:50 PM
  3. Stupid proxy pac
    By Oops_my_bad in forum Wireless Networks
    Replies: 10
    Last Post: 23rd March 2009, 09:59 AM
  4. Replies: 2
    Last Post: 29th April 2008, 03:17 PM
  5. Creating a PAC file
    By u8dmtm in forum Coding
    Replies: 4
    Last Post: 2nd March 2006, 03:49 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •