?
Solved

Internet explorer Proxy Pac file

Posted on 2011-04-22
14
Medium Priority
?
1,946 Views
Last Modified: 2012-05-11
We have just signed up for a messagelabs web filtering service.
I have installed the client site proxy on one of our servers (lets say 192.168.1.2). It uses port 3128.

We have several offices in our WAN. The idea is to deploy a pac file (I have called it proxy.pac)so that when our users are connected in one of our offices in the WAN, they use the client site proxy. When they are outside the office (eg at home), it uses direct access to the net.

I have played around with setting up a pac file, but dont seem to be able to get it to work. The CSP works fine as I can add the CSP address into the proxy server address is IE and it works. But not with the pac file. I have attached the pac file I am using (I have changed the office IP ranges for privacy reasons). Lets assume the office ranges are 192.168.1.0\24, 192.168.2.0\24 and 192.168.3.0\24.

If you could have a look over my pac file (attached as proxy2.txt) and see if I have made any errors?

Once this is clarrified, I have a question about deployment.  proxy2.txt
0
Comment
Question by:Mayogroup
  • 7
  • 7
14 Comments
 
LVL 7

Expert Comment

by:Martin81
ID: 35447250
I don't think you need the square brackets around your proxy address and port, and you're missing a curly bracket at the end on the script.

See attached
proxy2.txt
0
 

Author Comment

by:Mayogroup
ID: 35447742
Perfect. Worked straight away. However, I need to add a trigger to bypass local addresses.
Is this possible?
0
 
LVL 7

Expert Comment

by:Martin81
ID: 35447959
Yep, you can add a line for each exception in the following format.

if (shExpMatch(url, "*mydomain.com")) return "DIRECT";

Add these lines at the start of the script. You can also add comments to the script to make it easier to read by add // at the start of a line. Example attached.
proxy2.txt
0
Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

 

Author Comment

by:Mayogroup
ID: 35452569
Thanks for that.
Lets assume our intranet URL is http://intranet

would I add it as

if (shExpMatch(url, "http://intranet")) return "DIRECT";

Have tried this and it doesnt seem to work.
0
 
LVL 7

Expert Comment

by:Martin81
ID: 35452677
I think you need a space after 'url, ' , also try with return "direct"; in curly brackets.

if (shExpMatch(url,  "http://intranet")) { return "DIRECT"; }
0
 

Author Comment

by:Mayogroup
ID: 35454782
Still no luck.
0
 
LVL 7

Accepted Solution

by:
Martin81 earned 2000 total points
ID: 35456043
A few variations to try, hopefully any of these should work

1. if (shExpMatch(url,  "http://intranet*")) { return "DIRECT"; }
2. if (shExpMatch(url,  "intranet*")) { return "DIRECT"; }
3. if (shExpMatch(url,  "*intranet*")) { return "DIRECT"; }
4. if (shExpMatch(host, "http://intranet*")) { return "DIRECT"; }
5. if (shExpMatch(host, "*intranet*")) { return "DIRECT"; }
6. if (isPlainHostName(host)) { return "DIRECT"; }


0
 

Author Comment

by:Mayogroup
ID: 35464026
Perfect, variation number 1 worked.

Now, to deploy to the users.
Where should I host the pac file? on our web site or in a network share?
0
 
LVL 7

Expert Comment

by:Martin81
ID: 35466640
I'd go with a network share, then add a computer startup script that copies it from the network share to the local machines and apply the pac file from there.

So the startup script is just a batch file containing something like

IF NOT EXIST "C:\support\Proxy.pac" xcopy "\\server\share\Proxy.pac" "C:\support\" /y /C

Apply that as a startup script via group policy.

Then set your group policy to apply the pac file from User configuration/windows Settings/Internet Explorer Maintenance/connection/Automatic Browser Configuration

Under auto proxy URL add the path to the Pac file in the following format

file://c:/Support/proxy.pac
0
 

Author Comment

by:Mayogroup
ID: 35471465
Awesome.

It's all working great.

Next issue. This works on Internet Explorer. But not in Firefox. How do I apply this to firefox?
0
 

Author Comment

by:Mayogroup
ID: 35471569
Just tried to add the Pac file location in Firefox for testing. I have the following issue.

I add the location (same as the one used for IE) in the "Automatic Proxy Configuration URL".
file://\\pac file location\proxy.pac
But after clicking OK, the path changes to file:////pac file location/proxy.pac, so obviously it wont work.

Can I only use Web URL's for Firefox and not share file locations?
0
 
LVL 7

Expert Comment

by:Martin81
ID: 35471666
I'm not sure on firefox, you're probably best to post a new question for that.
0
 
LVL 7

Expert Comment

by:Martin81
ID: 35471719
Actually I've just tried browsing files in firefox and it uses 3 slashes in file:///c:\ so for a UNC path I think you need five slashes, so try file://///pac file location/proxy.pac
0
 

Author Comment

by:Mayogroup
ID: 35471781
no luck.
I dont see how it will work as the slashes between folders need to be \ and not / for a UNC path.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
Following on from our article on "The Murky World of Consent and opt in", we thought we would issue some helpful guidance, not only on consent itself but knowing what information you are capturing, what you are doing with this data and how you can p…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

749 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