+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
Windows Thread, .pac file problem in Technical; Hi, Below is the copy of a .pac file in use on a network. It points to a proxy server ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466

    .pac file problem

    Hi,

    Below is the copy of a .pac file in use on a network. It points to a proxy server hosted at the LEA All was working well until the LEA turned on AD integration and load balancing on at there proxy server. Sometimes it works and sometimes it doesn't. For the life of me i cant figure out if there is anything wrong with it. If i put the proxy setting in directly into IE it works 100% of the time. I am setting the .pac file by group policy.

    Can anyone see if there are any problems with it please?

    Thanks

    Code:
     
    function FindProxyForURL(url, host)
    
    {
    
    //Declare proxy strings as variables
    
    var capitaproxy = "PROXY 10.112.5.193:80";
    
    // IP not to use proxy
    
    if (shExpMatch(url, "*172.*")) { return "DIRECT"; }
    if (shExpMatch(url, "*10.*")) { return "DIRECT"; }
    if (shExpMatch(url, "*192.*")) { return "DIRECT"; }
    if (shExpMatch(url, "*127.0.0.1*")) { return "DIRECT"; }
    if (isPlainHostName(host)) { return "DIRECT"; }
    
    // URLS not to use proxy server
    
    
    if (shExpMatch(url, "*proxy*")) { return "DIRECT"; }
    if (shExpMatch(url, "*localhost*")) { return "DIRECT"; }
    if (shExpMatch(url, "*sta-xendesktop.lea.edu.local*")) { return "DIRECT"; }
    if (shExpMatch(url, "*dm-msw01.rochdale.edu.local*")) { return "DIRECT"; }
    if (shExpMatch(url, "*127.0.0.1:49745*")) { return "DIRECT"; }
    if (shExpMatch(url, "*172.16.128.139:60080*")) { return "DIRECT"; }
    if (shExpMatch(url, "*fp-wsus:9675*")) { return "DIRECT"; }
    if (shExpMatch(url, "*172.16.128.128:9675*")) { return "DIRECT"; }
    if (shExpMatch(url, "*fp-av*")) { return "DIRECT"; }
    if (shExpMatch(url, "*fp-av.falinge.int*")) { return "DIRECT"; }
    if (shExpMatch(url, "*172.16.128.132*")) { return "DIRECT"; }
    
    
    // Slect Proxy Server
    
    if (isInNet(myIpAddress(), "172.16.4.0", "255.255.252.0")) { return capitaproxy; }
    if (isInNet(myIpAddress(), "172.16.128.0", "255.255.252.0")) { return capitaproxy; }
    if (isInNet(myIpAddress(), "172.16.140.0", "255.255.255.0")) { return capitaproxy; }
    if (isInNet(myIpAddress(), "172.16.141.0", "255.255.255.0")) { return capitaproxy; }
    
    else
    
    return "DIRECT";
    
    }

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,632
    Thank Post
    250
    Thanked 2,909 Times in 2,141 Posts
    Rep Power
    829
    Would it be possible to try this?

    Code:
    function FindProxyForURL(url, host)
    
    {
    
    // -----------------------------------------------------------------------------
    // Declare proxy strings as variables
    // -----------------------------------------------------------------------------
    var capitaproxy = "PROXY 10.112.5.193:80";
    var no_proxy    = "DIRECT";
    
    
    // -----------------------------------------------------------------------------
    // Some proxies may have issues with mixed-case URLs, so change host variable to
    // all lower case, and resolve the host IP to reduce DNS lookups later
    // -----------------------------------------------------------------------------
        host = host.toLowerCase();
        var resolved_ip = dnsResolve(host);
    
    
    // -----------------------------------------------------------------------------
    // If URL has no dots in host name, send traffic direct
    // -----------------------------------------------------------------------------
    
        if (isPlainHostName(host))
        {
            return no_proxy;
        }
    
    
    // -----------------------------------------------------------------------------
    // IPs not to proxy
    // -----------------------------------------------------------------------------
    // If destination is to an RFC 1918 IP, return direct:
    
        if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") ||
            isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
            isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
            isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
        {
            return no_proxy;
        }
    
    
    // -----------------------------------------------------------------------------
    // IPs to proxy
    // -----------------------------------------------------------------------------
    // If request matches certain hosts in our IP range, return capitaproxy:
    
        if (isInNet(resolved_ip, "172.16.4.0", "255.255.252.0") ||
            isInNet(resolved_ip, "172.16.128.0", "255.255.252.0") ||
            isInNet(resolved_ip, "172.16.140.0", "255.255.252.0") ||
            isInNet(resolved_ip, "172.16.141.0", "255.255.252.0"))
        {
            return capitaproxy;
        }
    
    
    // -----------------------------------------------------------------------------
    // Hosts not to proxy
    // -----------------------------------------------------------------------------
    // If request matches, return direct:
    
        if (shExpMatch(host, "proxy") ||
            shExpMatch(host, "localhost") ||
            shExpMatch(host, "*fp-av*") ||
            shExpMatch(host, "*fp-av.falinge.int") ||
            shExpMatch(host, "*fp-wsus:9675") ||
            shExpMatch(host, "dm-msw01.rochdale.edu.local") ||
            shExpMatch(host, "sta-xendesktop.lea.edu.local"))
        {
            return no_proxy;
        }
    
    
    // -----------------------------------------------------------------------------
    // Default return direct rule
    // -----------------------------------------------------------------------------
    // If the request matches no other parsing rules, return direct:
    
    else
            // javascript:alert ("PAC finished parsing for: " + host + "\nFrom IP: " + myIpAddress() + "\nReturning: " + no_proxy);
            return no_proxy;
    }

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    Nope doesnt work i am afraid. Thanks anyway

  4. #4


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,632
    Thank Post
    250
    Thanked 2,909 Times in 2,141 Posts
    Rep Power
    829
    Does your proxy.pac file work fine in other browsers such as Firefox?

    Do you have the issue described here?

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    I tried in Chrome and i still get the issue. But chrome does pick its settings up from IE.

    The LEA is using NetSweeper.

    I will try to disable proxy caching

    Thanks

  6. #6

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    Interesting, when i use Server 2008 R2 as the OS the problem doesnt seem to happen. If i use a Windows 7 machine in the same VLAN it doesnt work....

  7. #7


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,632
    Thank Post
    250
    Thanked 2,909 Times in 2,141 Posts
    Rep Power
    829
    That's strange! Do both OSs have the same version of Internet Explorer installed e.g. IE9?

    Are there any policies set in NetSweeper which would only affect the Windows 7 PCs?
    Last edited by Arthur; 1st January 2012 at 09:05 AM.

  8. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    No idea about NetSweeper, its not looked after by the school.

    They both run IE 9. I logged on an RDS server (running 2008 R2) and it doesnt seem to work on there.

  9. #9


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,489
    Thank Post
    868
    Thanked 855 Times in 675 Posts
    Rep Power
    197
    Describe "doesn't work" more clearly if you would...

  10. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    We just get connection to the internet asif there wasnt a proxy set at all.

    Thanks

  11. #11

    Join Date
    Nov 2011
    Posts
    219
    Thank Post
    262
    Thanked 23 Times in 19 Posts
    Rep Power
    12
    Have you tested with the pac file boiled right down to the minimum? Say:
    Code:
    function FindProxyForURL(url, host)
    {
    return "PROXY 10.112.5.193:80";
    }
    That might help diagnose whether the problem had anything to do with your particular pac code.

  12. #12


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,489
    Thank Post
    868
    Thanked 855 Times in 675 Posts
    Rep Power
    197
    What are the IPs of the machines that do and don't work. I'm not sure I like those if statements at the end.

  13. #13

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    Quote Originally Posted by Jollity View Post
    Have you tested with the pac file boiled right down to the minimum? Say:
    Code:
    function FindProxyForURL(url, host)
    {
    return "PROXY 10.112.5.193:80";
    }
    That might help diagnose whether the problem had anything to do with your particular pac code.
    Will give it a try

    Quote Originally Posted by tom_newton View Post
    What are the IPs of the machines that do and don't work. I'm not sure I like those if statements at the end.
    Anything in these ranges

    172.16.128.1 - 172.16.131.254
    172.16.4.1 - 172.16.7.254
    172.16.140.1 - 172.16.140.254
    172.16.141.1 - 172.16.141.254

  14. #14
    DT2
    DT2 is offline
    DT2's Avatar
    Join Date
    May 2011
    Location
    Lakeville, Carleton County, New Brunswick
    Posts
    695
    Thank Post
    140
    Thanked 197 Times in 138 Posts
    Rep Power
    75
    Is the GPO failing? try a gpresult and see what gives.
    Might be that you're better off pushing the pac file by dhcp or dns and setting GPO to automatically detect settings..

    DT

  15. #15

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,315
    Thank Post
    901
    Thanked 1,798 Times in 1,549 Posts
    Blog Entries
    12
    Rep Power
    466
    No its not failing. GPO is working perfectly. Its being set but IE is just not connecting to the net.



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Ruckus problems with WPAD and PAC files
    By cookie_monster in forum Wireless Networks
    Replies: 2
    Last Post: 18th February 2011, 12:32 PM
  2. Proxy.Pac Config File Problems
    By FN-GM in forum Coding
    Replies: 3
    Last Post: 9th December 2010, 11:12 AM
  3. .pac file problem
    By mrbios in forum Scripts
    Replies: 3
    Last Post: 16th October 2009, 12:28 PM
  4. Offline files problems after server rebuild
    By plexer in forum Windows
    Replies: 6
    Last Post: 3rd September 2006, 10:23 PM
  5. Creating a PAC file
    By u8dmtm in forum Coding
    Replies: 4
    Last Post: 2nd March 2006, 04:49 PM

Thread Information

Users Browsing this Thread

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

  1. MrPstv

Posting Permissions

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