2014년 12월 3일 수요일

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

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!

댓글 없음:

댓글 쓰기