Sharing one port among multiple node.js HTTP processes Sharing one port among multiple node.js HTTP processes linux linux

Sharing one port among multiple node.js HTTP processes


If you are interested in a node.js solution check out bouncy, a websocket and https-capable http router proxy/load balancer in node.js.

Define your routes.json like

 {      "beep.example.com" : 8000,      "boop.example.com" : 8001 }

and then run bouncy using

 bouncy routes.json 80


Personally, I'd just have them all listen on dedicated ports or preferably sockets and then stick everything behind either a dedicated router script or nginx. It's the simplest approach IMO.


For connect middleware there is vhost extension. Maybe you could copy some of their concepts.