The Secret Behind the Auto Proxy Setting

While most people surf the Internet for pleasure, I mostly browse for knowledge. I.e., there will be lots of times that I need to revisit a page again and again. Hence, I configured my squid local http caching server. All machines in my home are using it, so even if I browse back to the page again on a different machine, the page loading will be still lightening fast as they all contribute to the squid caching pool. I’m happy with it.

However, there are times that my friends or colleagues coming to my home. If that happens, mostly likely we will be focusing on the same thing, meaning, we will be browsing the same sites, and same pages. The problem is, despite that the sites/pages have been cached locally, my visitors can’t easily use it, and have to request from outside each on their own. I’m not happy with it, and now decided to deal with it.

This prompted me to look into the mechanism behind all the browser’s automatic proxy settings. Can I setup something similar in my home so that my visitors can enjoy my caching server easily?

It turns out to be very easy. There are two mechanisms involved:

  • The first is an old one — PAC, Proxy Auto Configuration, which is based on a javascript function that takes the requested URL by the browser, processes it, and returns instructions to the browser on where to get the requested web page (or any other file).
  • The second one, WPAD, Web Proxy Automatic Discovery, extends the PAC mechanism by providing the Automatic Proxy Configuration URL through standard network services such as DNS and DHCP.

The best mechanism that covers as much cases as possible is the DNS-based WPAD. All these look not that difficult. It should not be difficult for me to put them into my dbab package, which is the package that I put together for “Dnsmasq-Based Ad-Blocking”.

I’ve collected all the relevant knowledge here at, and will work on my dbab package next, and report back.

Stay tuned.


One thought on “The Secret Behind the Auto Proxy Setting

  1. Pingback: Use new dbab to set proxy automatically | SF-Xpt's Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s