On Thu, 6 May 2004, Matt wrote:

> Is there a way with proxy.pac file to redirect all port 80 traffic to a
> proxy but not any other traffic?
> 
> function FindProxyForURL(url, host)
>   {
>       if (url.substring(0, 5) == "http:") {

try replace that line by

        if (url.port = 80) {

Not sure this will work, but maybe..  can not find any reference on the 
class of the url object sent to FindProxyForURL, but I am hoping it is 
kind of like the browser Location object.. but maybe it is just a String 
object..

>         return "PROXY my.proxy:8080";
>       }
>       else {
>         return "DIRECT";
>       }
>   }
> 
> for instance the above wont work.  If it has an "http:" in url it gets
> redirected.  What if someone enters www.mydomain.com I still want it to go.

This it should.

> And if someone enters www.mydomain.com:8080 I do not want it to go.

This should still match what you wrote above, and will go to the 
proxy.

Regards
Henrik

Reply via email to