2

The web application we develop is doing certain things depending on the domain and subdomains in the address. To be able to develop and test everything on a local environment, one would need to bind the domains to 127.0.0.1, using the hosts file.

However, this would cut that machine off from accessing the live server domains.

Question: Is there a browser-level hack that allows one to do hosts-like stuff, only for that browser?

UPDATE: A proxy .pac file can do this just fine. Like this:

function FindProxyForURL(url, host) {
      if (shExpMatch(url,"*.example.com/*")){
         return "PROXY 127.0.0.1:80";
      }
   }

Yay!

JdeBP
  • 3,970
  • 17
  • 17
Gabriel R.
  • 165
  • 8
  • Searching for Firefox add-ons here https://addons.mozilla.org/en-US/firefox/search/?pp=20&pid=1&cat=all&q=domain+ip&lver=any&page=2 only returns one possibly useful, but limited to Linux. We also use Mac and Windows. – Gabriel R. Nov 11 '10 at 15:42

2 Answers2

3

You can do pretty clever things with a proxy auto-config file. Try one that returns PROXY 127.0.0.1:80 for the domains you want affected and DIRECT for the rest.

ephemient
  • 1,420
  • 1
  • 11
  • 8
1

Maybe there's a HTTP proxy that will do what you want?

RedGrittyBrick
  • 3,792
  • 1
  • 16
  • 21