DevOps

Polipo — caching web proxy

I needed to map one port to another while tunneling over SSH. It's a common problem — you have a proxy on one port but need traffic from another port to r...

13 Oct 2023

Polipo — caching web proxy

I needed to map one port to another while tunneling over SSH. It's a common problem — you have a proxy on one port but need traffic from another port to reach it. A colleague pointed me to Polipo, a small caching web proxy written in C.

What Polipo does

Polipo sits between your browser (or application) and the internet. It caches HTTP responses locally, so repeated requests don't hit the remote server. It's small, fast, and designed for personal or small-group use.

Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.

What made it interesting

Polipo uses HTTP/1.1 pipelining when it detects the remote server supports it. That means it sends multiple requests over a single connection without waiting for each response — even if the incoming requests arrive on separate connections. Most proxies at the time (like Squid) only used persistent connections, not true pipelining.

The trade-off

Polipo is no longer actively maintained. For modern use cases, tools like Squid, Nginx (as a reverse proxy), or even SSH's built-in port forwarding (-L and -R flags) are better supported options. But Polipo was a clean, minimal solution for its time, and understanding how it worked taught me a lot about HTTP connection management and caching strategies.

If you're curious, the source is still available on GitHub.