Proxy.pac file – accessing a site on non standard port to be sent direct

pacPROXY

We are about to start using a proxy.pac file in our environment. It will be a very simple file with most traffic going to the proxy but a handfull of sites going direct (where they are hosted internally etc).

We have a couple of sites that need adding to go direct, but only on specific ports. By this i mean

http://www.test.com – Through Proxy
http://www.test.com:765 – Go direct

Anyone able to suggest how I do this, as I cant even get it to work with the in url option.

Thanks

Best Answer

This seems to work fine for me:

function FindProxyForURL(url, host) {

    if ( shExpMatch(url, "http://www.test.com:765/*") ) { return "DIRECT"; }

    return "PROXY proxy:port";
}

BTW, you can use alert() for debugging, at least under IE. It's crappy, but it at least gets you some insight into what the script is doing. Obviously, remove them before going into production.