Just another WordPress.com weblog

A *Useful* HTTP Proxy Server in 66 Lines of node.js Code

It runs from the command line and has no dependencies other than node.js (I was tempted to add handling via command.js but that can wait).

Node is a Javascript engine based on V8, the one behind Google Chrome. It’s available for most OSes and is an easy install. It’s in the Ubuntu repository but to be more up-to-date check this ppa.

I got stuck earlier with a bit of work-work where clicking on a browser submit button wasn’t doing what it should have, with Chrome dev tools I couldn’t be sure if it was redirecting or what. Cue a proxy. I used to use the Java one that was bundled in with Axis2, but as it happens I made one in node.js recently (needed internally for Seki). A few tweaks later and here it is.