cc young
cc young

Reputation: 20213

does socket.io serving websockets need to physically be on port 80?

using node.js and socket.io to serve websockets

does socket.io need to be listening on port 80 - the real port for websockets, or can it be proxied to a different port, eg, port 8011, on the server?

the browser, using websockets, talks through 80/http. on the server haproxy redirects websockets to node.js.

right haproxy directs to 127.0.4.11:80. this works fine, but this requires sudo to run node.js.

would rather redirect to localhost:8011, but do not know if socket.io needs to actually be on port 80 to support websockets correctly.

Upvotes: 0

Views: 444

Answers (1)

Michelle Tilley
Michelle Tilley

Reputation: 159105

WebSockets (and Socket.IO) can run on any port; most developers will develop their servers on a high-numbered port specifically to avoid running as root in development. Furthermore, the Socket.IO wiki has a page on ports and which ones work for various firewall software.

Upvotes: 2

Related Questions