Ok today let's talk about something that's been bothering me for some time. Small thing but still... annoying. It's about Firefox, proxies and laptops. If you have a laptop that you use at home as well as at work you might have the same problem I have: changing the proxy settings all the time... so boring... keep reading...
Usually at work the internet connection goes through a proxy. Meaning when you use Wifi or ethernet cable at work, instead of being directly connected to the open internet your connection goes through another computer that is called a proxy. Just a minute explanation about why this happens: usually at work, the IT guys wants to have some control about where you surf to so they have this list of rules that says where you can and where you can't go on the internet. The proxy can be used to be that "bad" computer that act as the filter. You want something from the internet, your request first goes through the proxy, that checks if what you want is on an acceptable site and if so your request is transferred to the internet and brought back to you. Also a proxy can be a tool to save bandwidth: if many people at work want the same type of information on the same site, instead of asking the internet all the time, the proxy uses the information it has already gotten for someone else to give it back to you (of course this is upadated from time to time).
Ok enough about the technical jabber... Here's my problem. If there is a proxy at work, you need to tell your browser where the hell it is or else your connection will be sloppy or you might have no connection at all. So there is a place in Firefox preferences where you can tell him how Firefox can access the proxy. But well... at home... you don't need your laptop and Firefox to go through the proxy because you have a direct connection and also for privacy reasons you don't want the work proxy server to be even called from outside work where you do private stuff ...
The cheap solution is to change Firefox proxy preferences by hand each time you are at work or at home. Here's how to do that: go to Firefox preferences (on a Mac: Firefox's Firefox Menu-->Preferences or Settings-->Advanced Tab-->Network-->Connection part and click Settings... button, on Windows: Firefox's Tools Menu-->Preferences or Settings-->Advanced Tab-->Network-->Connection part and click Settings... button). There you will have this new beautiful window where you can choose between a direct connection to internet (what you want usually at home), autodetection of proxy settings (in my experience hardly works), manual proxy configuration (sometimes you or the IT guy have to change that part at work) or automatic proxy configuration url (most of the time this is the place where the IT guy puts a cryptic address that links Firefox to that proxy computer). So you have to switch between those options each time you are at home or at work... unbearable !
Here's my solution using a too little known Firefox plugin called MM3-ProxySwitch. This piece of nice software can automatically switch between a direct connection to internet and several proxy servers or proxy autoconfiguration files depending on where you are (home, work, internet café... where ever you need a proxy). But the thing is it doesn't do this out of the box. You have to beat the little thing around a little. And the rather cryptic documentation of this piece of soft doesn't help.
Ok let's do this now:
- Launch Firefox and download MM3 ProxySwitch (hereafter MM3) plugin here (if the link is outdated simply search MM3 ProxySwitch in the Firefox plugin site)
- Install, and restart Firefox
- Now let's add MM3 as a button to the Firefox icon bar: in Firefox Menu go to View-->Toolbars-->Customize. In the new window you should see the MM3 icon. Drag and drop it to your icon bar, for instance next to the Home icon. Don't worry, this is just for configuration, you can remove the icon later and forget about it.
- Now if you click on the little arrow next to the MM3 icon, you have a tiny menu where you have edit (try not to click the MM3 button itself but the small downward arrow). Click Edit. By default there will be a bunch of cryptic stuff there that you can erase.
- Replace what you just erased by these lines exactly:
[myproxysettings
url=xxxxxxxxxx
]
testUrl=yyyyyyyyyy both myproxysettings
- The square brackets, the "url=" and the "testUrl=" are MM3 commands that are mandatory for what you want to do. "myproxysettings" is just a random name I gave to the settings I want, you can choose whatever you want instead as long as you replace it everywhere. "xxxxxxxxxx" and "yyyyyyyyyy" are stuff we need to change in a moment and "both" is also a MM3 command I will explain.
- Here's what this stuff is going to do: each time you launch Firefox, the "testUrl" command will try to connect to an address that we will put later instead of "yyyyyyyyyy". "both" means that this check will be done whatever the initial proxy status of Firefox (direct internet connection or else). If "testUrl" successfully reaches the address in "yyyyyyyyyy" then MM3 will think that you are for instance at work, if it is unsucessful, it will think that you are for instance at home. If sucessful, MM3 will change the proxy status to what you have set in "myproxysettings" between the square brackets. For now, it will put the address "xxxxxxxxxx" given by the command "url=" inside Firefox's "Automatic proxy configuration URL" that we talked about earlier
- The tricky part is what should we replace "xxxxxxxxxx" and "yyyyyyyyyy" with. For "xxxxxxxxxx" it's easy. This is for instance your proxy setting at work. Just go to Firefox's proxy setting as we did earlier in the unbearable section above. Check what's written in the "Automatic proxy configuration URL" part and copy paste it instead of "xxxxxxxxxx". Alternatively ask the IT guy for the automatic proxy configuration address at work. The really really tricky part is what to put instead of "yyyyyyyyyy"... This should be some web address that you can reach all the time at work but never at home. One easy solution is to pick any web address in your intranet, the closed local network of your office. If you don't have an intranet, you can try the IP address of your network printer at work if you're sure there is nothing like that at home... there are many solutions it depends on your environment at work... think about a clever address to put there. In the end when you have found something to put instead of "xxxxxxxxxx" and "yyyyyyyyyy", your MM3 edit file should look like this (of course with your very own addresses instead of the fake ones I put there :-D ):
[myproxysettings
url=http://myworkurl.com/proxy.pac
]
testUrl=http://myintranetadress.mycompany.com both myproxysettings
Ok it's all set, next time you launch firefox, MM3 will detect where you are, and change your proxy settings to either direct connection or use the "Automatic proxy configuration URL". When testUrl is sucessful, the MM3 button will light up else it will be shaded.
Ok lets discuss a little more about possibilities. Of course you can apply this trick anywhere: home+internet café, home+GF's appartment etc. There are also other commands that can replace the "url=xxxxxxxx" part. The "url" command changes the "Automatic proxy configuration URL" in Firefox proxy settings. Instead all the commands below will change the "Manual proxy configuration part"
http=xxxxxxxx : this will change the HTTP proxy setting
ssl=xxxxxxxx : this will change the SSL proxy setting
ftp=xxxxxxxx : this will change the FTP proxy setting
gopher=xxxxxxxx : this will change the gopher proxy setting
socks=xxxxxxxx : this will change the SOCKS proxy setting
You can put either one or all the five commands above between the square brackets and it will change one or several Manual proxy configuration settings. Of course, it is useless to have one of the five above and at the same time the "url" command as these are alternatives.
Although I did not test this, I guess you could also have several "testUrl" commands associated to several square bracket configurations so that you can switch between direct connection and proxy at several places where there is a proxy.
Finally, more obscure possibilities are described at MM3's web site here, check it out.
Please let me know if this was useful in anyway in the comments !!
Cheers.
If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!








