Fri, 28 Dec 2007

proxylet: lightweight HTTP reverse proxy

I've just put enough finishing touches on my latest python project to release it into the wild: proxylet is a lightweight reverse proxy for HTTP with nonblocking IO courtesy of eventlet.

What's so great about it? It can do something no other reverse proxy currently does: proxy to a remote subversion server at an arbitrary remote path. Read on for why this is so difficult...

Subversion, in its infinite wisdom, uses absolute URLs in the body of its HTTP requests and responses. This means that if you want to have a proxy at http://www.example.com/svn send subversion traffic to http://svn.example.com/some/other/path, you need to rewrite the request and response bodies! This is such a dangerous business that most people just shy away from it, and insist that the local and remote paths be identical (example).

Not me! Proxylet contains enough reverse-engineered details of the subversion HTTP protocol (no, it's not just vanilla WebDAV) to achieve this in a safe, responsible manner.

Of course, proxylet can do more general reverse proxy work as well, but I haven't really pushed it in that direction yet. Python hackers looking for a flexible, lightweight reverse proxy solution should find proxylet a good starting point.



blog comments powered by Disqus