elfs: (Default)
[personal profile] elfs
The other day, I blogged proudly about a piece of code called Switchboard, which allowed you to create a reverse proxy with routes decided by URL rather than host. Nginx does this, but it only has HTTP/1.1 <–> HTTP/1.0 proxying and no control over buffer sizes. Varnish does all 1.1, but no SSL. Pound buffers uploads completely to RAM before forwarding. So I wrote Switchboard.

It turns out Switchboard is a massive hack to get around three bugs in the nodejitsu node-http-proxy library, which is what Switchboard uses. Once I realized this, I submitted three patches to the nodejitsu team, and have happily admitted that my code was a monstrous hack. A much smaller piece of code, two functions, each less than ten lines long, was all that was needed to replace the entire functionality of that 161-line monstrosity.

I'm very pleased with the results, however: I can now do HTTP/1.1 <–> HTTP/1.1 reverse proxying, have complete control over my upload buffer size, and can maintain proxied websockets and socket.io communications channels.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 28th, 2025 09:41 am
Powered by Dreamwidth Studios