This is a simple http proxy.
Because Firefox defaults to using HTTP/1.1 and your proxy speaks HTTP/1.0, there are a couple of minor changes that need to be made to Firefox's configuration. Fortunately, Firefox is smart enough to know when it is connecting through a proxy, and has a few special configuration keys that can be used to tweak the browser's behavior.
- Type'about:config'inthetitlebar.
- In the search/filter bar, type 'network.http.proxy'
- You should see two keys: network.http.proxy.pipelining, and network.http.proxy.version.
- Set version to 1.0. Make sure that pipelining is set to false.
- Manually set up proxy with host name localhost and port number with any portnumber you want to test on.
- In your terminal where this script is at, do python minimal proxy.py -portnumber.
- The portnumber of 5 and 6 needs to be matched.
A toy proxy for understanding how proxy actually works.
'www.baidu.com','www.cnn.com','www.nyu.edu','www.aol.com','www.dmv.org', 'www.stackoverflow.com','www.bbc.co.uk','www.youku.com','www.ticketmaster.com','www.columbia.edu' are blocked. These are set arbitrarily for test
Filtering words are: 'research’,’porn’. These are set arbitrarily for test