3 ms·
It's not hard to serve both regular http requests and web socket requests on the port 80 on the same host. Just use a special context path for web socket reques
by aslakhellesoy 16y ago
It's not hard to serve both regular http requests and web socket requests on the port 80 on the same host. Just use a special context path for web socket requests, for example /websocket/*
Some of the node.js websocket impls let you do this easily while others don't. Don't use the ones that require a separate port. Nobody behind a corporate firewall will be able to use your app if you do.
- lenary 16y agoI think it is possible to have a ws server listening on the same port (and even path) as an http server, hence it shouldn't really matter. And if you really care, you could make a http forwarding proxy with node to forward normal http requests through to your app if it's written in something else, but deal with websockets itself.