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