+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, .pac file problem in Coding and Web Development; Right where to start.. We have an aruba wireless system, with guest provisioning, if a student brings a laptop in ...
  1. #1
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,608
    Thank Post
    374
    Thanked 270 Times in 222 Posts
    Rep Power
    103

    .pac file problem

    Right where to start..

    We have an aruba wireless system, with guest provisioning, if a student brings a laptop in they can have an account created to access the wireless for a set amount of time, 99.99999% of the time this is to get access to he internet on their laptops.

    The issue is they need to NOT have a proxy set to get to the aruba login page, as this is an open system with it's own authentication, then once they login they then need the proxy settings set in order to access the internet, i'm trying to setup WPAD to automatically set their proxy settings with exceptions for internal sites.

    I've got the .pac file sorted here is the code:
    Code:
    function FindProxyForURL(url, host)
    {
    	if (shExpMatch(url, "http://webapps*")) { return DIRECT; }
    	if (shExpMatch(url, "http://172.18.77.3*")) { return DIRECT; }
    	if (shExpMatch(url, "http://172.18.66.3*")) { return DIRECT; }
    	if (shExpMatch(url, "https://172.18.77.3*")) { return DIRECT; }
    
          if (isInNet(host, "172.18.77.0",  "255.255.255.0"))    {
             return "PROXY staffproxy.swgfl.org.uk:8080";
          }
    else
    return "DIRECT";
    }
    Now im no coding wizz so this is just stuff i've cobbled together from what the internet has given me, so there are 4 exceptions which i don't want to use the proxy as one of them goes to the intranet and 2 of them go to the aruba authentication page, it looks at the IP address/subnet and sets a proxy server.

    Is the code correct first?

    I have the proxy.pac file hosted on http://webapps/proxy.pac which is set in the exceptions list above and i've tested that i can access that file from a laptop which isn't authenticated and isn't on the domain, which it can.

    I also have DHCP option 252 setup pointed to http://webapps/proxy.pac and have setup the MIME types on IIS for the site it is hosted under

    Is there anything i've missed, looking at it now the code doesn't seem right.....so .... yea HELP
    Last edited by mrbios; 14th October 2009 at 04:03 PM.

  2. #2
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,608
    Thank Post
    374
    Thanked 270 Times in 222 Posts
    Rep Power
    103
    Ah seems it was my code, this works:
    Code:
    function FindProxyForURL(url, host) {
        if (dnsDomainIs(host, "archway.local") ||
    	isInNet(host, "172.18.0.0", "255.255.255.0"))
    	return "DIRECT";
    	if (shExpMatch(url, "http://webapps:8026/*"))
    	return "DIRECT";
    	if (shExpMatch(url, "http://172.18.66.3*"))
    	return "DIRECT";
    	if (shExpMatch(url, "http://172.18.77.3*"))
    	return "DIRECT";
    	if (shExpMatch(url, "https://172.18.77.3*"))
    	return "DIRECT";
    	if (shExpMatch(url, "https://securelogin.arubanetworks.com/*"))
    	return "DIRECT";
        else
            return "PROXY staffproxy.swgfl.org.uk:8080; DIRECT";
    
    
    }
    Now i have another problem, I need a script that can run on a html webpage that will tick the "automatically detect settings" box on IE, anyone got anything like that?

  3. Thanks to mrbios from:

    K.C.Leblanc (16th October 2009)

  4. #3


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 433 Times in 352 Posts
    Rep Power
    126
    Quote Originally Posted by mrbios View Post
    Now i have another problem, I need a script that can run on a html webpage that will tick the "automatically detect settings" box on IE, anyone got anything like that?
    Even if something like that exists I'd imagine it would fireback all sorts of security warnings. Probably best to include instructions.

    Another option might be to put the whole system behind a smoothwall express and use transparent proxying.

  5. Thanks to K.C.Leblanc from:

    mrbios (16th October 2009)

  6. #4
    cromertech's Avatar
    Join Date
    Dec 2007
    Location
    Cromer by the coast
    Posts
    731
    Thank Post
    177
    Thanked 109 Times in 97 Posts
    Rep Power
    55
    This looks like it could hold your answer but would need to be a vbscript that the users would have to download.
    IE - Automatically Detect Settings - SOLVED
    Almost at the bottom of this page is a script that will turn off or on the checkbox.
    I would guess you could incorporate this into activex maybe to make it more seamless with the page but as i've never done this so i would probably just make it something they have to run

  7. Thanks to cromertech from:

    mrbios (16th October 2009)



SHARE:
+ Post New Thread

Similar Threads

  1. proxy .pac file
    By sted in forum Windows
    Replies: 12
    Last Post: 24th September 2009, 08:50 PM
  2. .pac files
    By jamiet147 in forum Coding
    Replies: 3
    Last Post: 26th November 2008, 09:51 AM
  3. Replies: 2
    Last Post: 29th April 2008, 04:17 PM
  4. 2 pac and 50 cent!!
    By bishopsgarthstockton in forum General Chat
    Replies: 20
    Last Post: 17th July 2007, 12:32 AM
  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 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
  •