Avoid editing ‘hosts’ file by using FoxyProxy plugin for FireFox
I love it when small utilities like this make web development so much easier. In my everyday development, I religiously edited the ‘hosts’ file. Yes, that file hidden away in the Windows folder that also requires special Admin security elevation in Vista. I managed to overcome all these items by locating a shortcut on my desktop that would open it in Notepad and be ready for editing. That was great for a while.

This method had a few downsides to it. When I try to switch between the localhost version of a site and a remote site many times within a short amount of time, the not so many steps that are needed all of a sadden seem a lot. More problematic is the fact that there is no indication as to which state a specific site is set at the moment: localhost or remote? and in some cases I ended up sending a completely broken site to the client who probably thinks I am a rookie with an internet connection. Don’t forget that when you change your hosts file, you also need to either restart the browser or go to the file menu, choose ‘work offline’and then ‘work online’ and refresh the site. None of that is necessary with a simple add-on to FireFox: FoxyProxy.
FoxyProxy acts as a proxy server between the Firefox and the internet. You set a ‘proxy’ which essentially allows you to direct traffic to a single point – I use one that directs traffic to ‘localhost’ – then you can add as many patterns as you want that will be associated with the Proxy. Once all is setup, you can then turn this Proxy on or off with a single right click at the bottom of the browser. For me, the setup is quite simple and it works great.
Ok, so there is one caviat here: sometimes I do need to test the websites in different browsers. In this case, this browser add-on will simply not cut it. But for most of my daily web dev needs – it is great!


