title: How can I give my browser localhost:80/foo.js when it asks for www.productionsite.com/foo.js?
body: <p>I'm doing work on "foo.js", a previous version of which is currently deployed on "www.productionsite.com". I'd like to see how the new version of foo.js behaves on the production version of productionsite.com before I actually deploy it. </p>
  
  <p>www.productionsite.com loads the script from <a href="http://www.productionsite.com/js/somescript.js" rel="nofollow">http://www.productionsite.com/js/somescript.js</a> I'd like to find a way to have my browser load <a href="http://localhost:80/js/somescript.js" rel="nofollow">http://localhost:80/js/somescript.js</a> instead</p>
  
  <p>I've worked out a way to do this using apache and mod_proxy: </p>
  
  <ol>
  <li><p>In /etc/hosts, re-route local.productionsite.com to localhost:80 (apache)
  Using mod_proxy, re-route all requests for local.productionsite.com/* to  www.productionsite.com/*</p></li>
  <li><p>Make exceptions in the proxy setup for any assets I want to load locally. i.e. </p></li>
  </ol>
  
  <p>This gets the job done, but is pretty cumbersome. What a want is a tool (presumably a proxy I'd point my browser to) which I can easily configure to replace specific assets, like:</p>
  
  <blockquote>
    <p><a href="http://www.productionsite.com/js/somescript.js" rel="nofollow">http://www.productionsite.com/js/somescript.js</a> = <a href="http://localhost:80/js/somescript.js" rel="nofollow">http://localhost:80/js/somescript.js</a></p>
  </blockquote>
  
  <p>or even </p>
  
  <blockquote>
    <p><a href="http://www.productionsite.com/js/somescript.js" rel="nofollow">http://www.productionsite.com/js/somescript.js</a> = <a href="http://dev.productionsite.com/js/somescript.js" rel="nofollow">http://dev.productionsite.com/js/somescript.js</a></p>
  </blockquote>
  
  <p>Is there any easier way to do this than what I'm currently doing? I'd prefer a mac os solution, but can use windows too.</p>