Solved

proxy.pac configuration

Posted on 2007-11-19
8
896 Views
Last Modified: 2009-07-29
Hi

Can someone please assist me with the creation of a proxy.pac file?

I need the following within the file, which will be stored on each user's pc & enforced by group policy:

* when a user is on our company's domain, I want every connection to the internet to go through the proxy server, except when the user is trying to access a handfull of sites (e.g. server1.ourcompany.com)

* when a user isn't on our domain (e.g. they have taken their laptop home), they need to access the internet without trying to go through our proxy server.

Thanks!

Ash
0
Comment
Question by:ashonline
  • 5
  • 2
8 Comments
 
LVL 4

Accepted Solution

by:
Beldoran earned 500 total points
ID: 20317366
In the wiki entry at http://en.wikipedia.org/wiki/Proxy_auto-config are some details on the things you can do.
About 2/3rds down the page is a Javascript example which could be modified to do what you want using the isInNet function. (the 'more complicated example')
0
 

Author Comment

by:ashonline
ID: 20324768
Thanks Beldoran, this will help me out.

Any ideas on the detection of whether the user's pc is on the domain or not?
0
 
LVL 4

Expert Comment

by:Beldoran
ID: 20324949
You can check for an IP range. I would assume that your domain has a defined/stable IP range?

or. If you use dhcp or/with particular dns servers you could also check these instead. That page had a reference to bunch of other functions which look interesting.

or. If your java programming is good you may be able to extract the domain name from the machine directly in the script. (My strength is vbscript in which it is trivial to do this, but that does not help here)
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 4

Assisted Solution

by:Beldoran
Beldoran earned 500 total points
ID: 20324995
Try this function,

dnsDomainIs(host,".mydomain.com")
0
 

Author Comment

by:ashonline
ID: 20337176
Hi Beldoran

Thanks for all your help with this.

Can you please advise on whether this proxy.pac file will be any good?

Thanks

Ash
function FindProxyForURL(url, host)

{

	var proxy_yes = "PROXY 192.168.0.129:8080";

	var proxy_no = "DIRECT";
 

	if (shExpMatch(url, "http://www.ourcompany.com*")) { return proxy_no; }

	if (shExpMatch(url, "http://www.anothercompany.com.au*")) { return proxy_no; }
 

	// Proxy if PC is on local LAN

	if (dnsDomainIs(host, ".ourcompany.com"))

		{ return proxy_yes; };

	else

		{ return proxy_no; };

}

Open in new window

0
 
LVL 4

Expert Comment

by:Beldoran
ID: 20337230
My Javascript is not that hot but it looks ok except for
http://www.ourcompany.com* may need to be http://www.ourcompany.com/*
same for http://www.anothercompany.com.au*

My reading of your script is that if it is going to www.ourcompany.com or www.anothercompany.com.au then there will be a direct connection. same for a host on .ourcompany.com. Everything else goes direct.
0
 
LVL 4

Assisted Solution

by:Beldoran
Beldoran earned 500 total points
ID: 20337283
I am using this page for a function reference
http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html

From this I am not sure it will work as from the page above "host =
the hostname extracted from the URL. This is only for convenience..."
This means that it is the page that is being asked for not the actual host.

A possible solution is to add an entry in your internal DNS for (say) "internal" and use this function (may not by syntactically correct)

        if (isResolvable("http://internal.ourcompany.com"))
          { return proxy_yes; };
        else
          { return proxy_no; };

This means that if you can resolve this host you MUST be on the internal network so use the proxy otherwise go direct
0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

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

Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

920 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now