When using a browser like Firefox I need that any url of the domain example.com to have appended the port :8008. Not only when I type it at address bar but any where it is referenced within the served html page. All the other domains should be left as is.

I know I can setup a proxy like Squid or use a pac file in a web site but I want it simpler if possible.

link|improve this question
feedback

1 Answer

up vote 0 down vote accepted

I figured out how to do it using a local pac file (no need for a server):

function FindProxyForURL(url, host) { 
   if (shExpMatch(host, "*example.com")) {
      return "PROXY " + host + ":8008";
   }
   return "DIRECT"; 
}

I saved the file as /home/username/local.pac (it is a Linux system). I think it can be named anything. Then in Firefox I went to Edit -> Preferences -> Advanced -> Network -> Settings -> Automactic proxy configuration URL and entered the address as file:///home/username/local.pac. Note the 3 slashes after "file:"

link|improve this answer
can you give more detail? where does this pac file go? does it need to be called anything special (like foo.pac)? – quack quixote Jun 18 '10 at 17:11
feedback

Your Answer

 
or
required, but never shown

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