Internet explorer Proxy Pac file

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
MayogroupAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Martin81Commented:
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
 
MayogroupAuthor Commented:
Perfect. Worked straight away. However, I need to add a trigger to bypass local addresses.
Is this possible?
0
 
Martin81Commented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
MayogroupAuthor Commented:
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
 
Martin81Commented:
I think you need a space after 'url, ' , also try with return "direct"; in curly brackets.

if (shExpMatch(url,  "http://intranet")) { return "DIRECT"; }
0
 
MayogroupAuthor Commented:
Still no luck.
0
 
Martin81Commented:
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

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
MayogroupAuthor Commented:
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
 
Martin81Commented:
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
 
MayogroupAuthor Commented:
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
 
MayogroupAuthor Commented:
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
 
Martin81Commented:
I'm not sure on firefox, you're probably best to post a new question for that.
0
 
Martin81Commented:
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
 
MayogroupAuthor Commented:
no luck.
I dont see how it will work as the slashes between folders need to be \ and not / for a UNC path.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.