Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Why not set up an internal proxy to proxy test.com:765 etc with a virtualhost and add that to the proxy.pac ?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.