Virtual Hosts + Proxying + Request Rewriting (while supporting WebSockets)

31 views
Skip to first unread message

Jimb Esser

unread,
Dec 1, 2014, 9:36:03 PM12/1/14
to nod...@googlegroups.com
I couldn't find any good examples combining express routes (vhost specifically) and node-http-proxy, and especially not that worked with WebSockets.  While converting a slew of low-traffic sites and apps, all hosted on one box, from an old hybrid HAProxy/Apache/Node stack to just Node, I put together a blog post [1] about it, with the code necessary to combine these (have to do a reasonable amount of manual work to combine express vhosts, proxies, and WebSockets).  Also, mostly for amusement's sake, I also wrote a companion post [2] about all of the things that went wrong while supporting some legacy clients hitting this server - Node's HTTP parser was throwing exceptions on some slightly malformed requests and I had to do a few things to work around it.

Hope someone finds this useful!
Reply all
Reply to author
Forward
0 new messages