Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

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:"

share|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
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.