6093 comments
2357 subscribers
6238 on Twitter
Subscribe! Feed reader E-mail

Automatically detecting proxy settings


Having gotten sufficiently annoyed at the need to maintain two Mozilla
Firebird profiles just because I use a proxy in school and none at
home, I decided to look up the “Automatically detect proxy
configuration” option. After some digging around, this is the answer I found:

This goes into my /etc/laptop-net/profiles/school/files.d/var/www/proxy.js:

function FindProxyForURL(url,host)
{ if(isPlainHostName(host)||
    isInNet(host,"10.0.0.0","255.0.0.0")) return "DIRECT";
      else return "PROXY proxy.admu.edu.ph:3128; DIRECT";
}

and this goes into my /etc/laptop-net/profiles/home/files.d/var/www/proxy.js:

function FindProxyForURL(url,host)
{
  return "DIRECT";
}

I deleted the other profile and changed my settings to automatically
detect the proxy configuration from file:///var/www/proxy.js .
Tada! No more worries. It just works.

Short URL: http://sachachua.com/blog/p/981
  • Jon

    I guess you must be using a Linux system. How would I accomplish this on my windows system?

  • http://sachachua.com Sacha Chua

    Oh. Umm. You would probably switch to Linux. Sorry about that…

  • Jon

    No problem. Thanks for the response.

On This Day...

  • 2012: Monthly review: July 2012 — Last month, I wrote: In July, I’d like to deliver a talk, sketchnote three more events, learn more about EPUBs, [...]
  • 2011: Jalapeño jelly — I stirred the jalapeño jelly mixture as it boiled, mock-grumbling about the heat and humidity. “Why do we do this [...]
  • 2010: On finding a great job — Cate Huston blogged: I have put this huge stress on myself because I really want to have a job lined up [...]
  • 2009: Observational humour and solo improv play — Check out this humour specialist’s observational humor monologues based on real-life events at his Toastmasters Club. It sounds like the kind [...]
  • 2009: Gardening and cats — I trimmed back the tomatoes as they had been threatening to take over the entire vegetable plot. Judging from the [...]
  • 2007: Thesis defense is tomorrow — The end is in sight. In fact, it’s in less than 12 hours. Whee! Right. Shower, then pick out clothes. Must remember [...]
  • 2006: Karaoke night — Went to Kick-Ass Karaoke Night with Joey de Villa, Wendy, Quinn, Jed, and a bunch of random strangers. Sang “Always Look on [...]
  • 2005: Level up! — Adobo was _perfect._ Or at least it inspired enough confidence for me to store two portions in the refrigerator and four [...]
  • 2005: Getting my own domain name — I want my own domain name. Can anyone recommend a relatively cheap but reliable domain name registry for .com addresses? Thanks! On [...]
  • 2005: Slightly dissatisfied — The university Internet service has intermittent problems with DNS and quality of connection. I’m beginning to wonder how much trouble it would [...]
  • 2004: Poi videos — http://sacha.free.net.ph/notebook/pics/ poi-20040806-*
  • 2003: e-learning conference tomorrow — Manila Hotel then rush back to school
  • 2003: Oops, forgot my keys — Forgot my keys again today. I guess I’m going home later…
  • 2003: Dominique’s birthday — Dominique’s birthday’s on December 27.

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!