3 ms·
Client-side proxies were a great deal of fun. I started in 1997 with the idea that I could intercept java applets and inspect/modify the byte code. For example
by amitp 3y ago
Client-side proxies were a great deal of fun. I started in 1997 with the idea that I could intercept java applets and inspect/modify the byte code. For example I scanned for "new Sound()" and created a gui frame with play/stop buttons for each sound object created. I also blocked some URLs from loading (e.g. ads).
By 1998 I realized that the ad blocking part was much more interesting to me than modifying java applet bytecode, and I started modifying HTML and other content. Instead of just blocking the ads, I removed that HTML so that the layout would change. But I also experimented with altering images, so for example I changed Slashdot's color from green to blue by changing the bytes in the GIFs. I altered headers (e.g. blocking cookies), and also used the Referer header to change the page (e.g. highlighting search words if the Referer was a search engine url). Seeing that I could make the web much faster, I started doing other things, like caching and DNS prefetching (long before Chrome existed). DNS lookup was really slow, in part because Netscape used a single thread implementation (if I remember right).
By 2000 I was using the proxy to implement parallel DNS lookup, chunked encoding, gzip encoding, keep-alive, request reuse. Most of these weren't yet available in browsers, but I implemented them in the proxy and presented a regular HTTP/1.0 connection to the browser. For example if the browser saw three GIFs to the same URL, it'd request that three times. The proxy would intercept these, make one request with gzip, and then feed that data to the three connections the browser made. Web surfing was so much faster with this proxy.
I continued using my client-side proxy for many years after that but over time it became less appealing and I no longer use them today.
I have my proxies written up at http://theory.stanford.edu/~amitp/proxy.html http://theory.stanford.edu/~amitp/proxy.html ; also see WebCleaner, a proxy based on mine https://webcleaner.sourceforge.net/ https://webcleaner.sourceforge.net/