Which port to use with socket.io?

lombrozo

Which port should I listen/emit on when using socket.io?

I was originally using 2053 with my SSL website, but found, after using the website in a school, that 2053 had been blocked.

So, is there a particular port I should use that is guaranteed not to be blocked? Or should I assume it could be blocked?

Thanks.

jfriend00

First off, if you're using node.js to serve both your website and your socket.io connections, then you would typically use the same port for socket.io as you use for your web site (whateve port number that is). Since most websites are servered on port 80 (http) or 443 (https), that's what you would use. Since every webSocket connection (which is what socket.io is based on) starts with an http(s) request, they can share a port with your regular web requests and this is a central part of the webSocket design. This also simplifies same origin request security in the browser since no cross origin header support is needed to connect to the same host/port as the web page came from.

For professionally hosted sites, you will probably have to refer to the instructions for using webSocket connections for your particular hosting company. Because webSocket/socket.io connections are long lasting, they often require specific support in a typical hosting environment and may need to be done a particular way. And, because the hosting company may be sharing infrastructure among many sites, you are often assigned specific ports which you can use and are not necessarily free to use just any port.

For your school-end of the connection, ports 80 and 443 will be open as long as the school allows browsing on the internet so those are your safest bets.

FYI, the site http://portquiz.net/ is listening for http requests on all ports so you can test any port you want with it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Vue - How to use a different socket.io port in tests?

From Dev

Socket IO econnrefused on port 3000

From Dev

Port hopping on IO::SOCKET::INET

From Dev

Port hopping on IO::SOCKET::INET

From Dev

How do I get my node/socket.io app to use the correct port when deployed to heroku?

From Dev

How do I get my node/socket.io app to use the correct port when deployed to heroku?

From Dev

How would I choose in java that which port is free to use for ServerSocket or Socket?

From Dev

perl socket: increment port if in use

From Dev

Use socket.io in controllers

From Dev

Use Socket.IO with Servlet

From Dev

Use Socket.IO with Servlet

From Dev

Not able to use socket io in heroku

From Dev

socket.io get rooms which socket is currently in

From Dev

Socket.io client ignoring port when namespace used [Bug?]

From Dev

How do you run express and socket.io on the same port

From Dev

Sharing same port for REST endpoints and netty socket.io?

From Dev

Go & Socket.io HTTP + WSS on one port with CORS?

From Dev

How to configure Socket.io to run on same port on https?

From Dev

Node.js - Using Socket.io and Express on the Same Port

From Dev

Using node js library Socket io without port

From Dev

node.js+socket.io port not opening with ssl

From Dev

socket.io try to listen to default apache port

From Dev

socket.io port for every chat room javascript

From Dev

How to start node express, binaryserver and socket.io on same port?

From Dev

Run socket.io 2.0 and Express 4.0+ on the same port

From Dev

express app and socket.io chat in different port?

From Dev

which port visual studio use for web deployment?

From Dev

Which port to use for Network discovery application

From Dev

How to find which serial port is in use?

Related Related

  1. 1

    Vue - How to use a different socket.io port in tests?

  2. 2

    Socket IO econnrefused on port 3000

  3. 3

    Port hopping on IO::SOCKET::INET

  4. 4

    Port hopping on IO::SOCKET::INET

  5. 5

    How do I get my node/socket.io app to use the correct port when deployed to heroku?

  6. 6

    How do I get my node/socket.io app to use the correct port when deployed to heroku?

  7. 7

    How would I choose in java that which port is free to use for ServerSocket or Socket?

  8. 8

    perl socket: increment port if in use

  9. 9

    Use socket.io in controllers

  10. 10

    Use Socket.IO with Servlet

  11. 11

    Use Socket.IO with Servlet

  12. 12

    Not able to use socket io in heroku

  13. 13

    socket.io get rooms which socket is currently in

  14. 14

    Socket.io client ignoring port when namespace used [Bug?]

  15. 15

    How do you run express and socket.io on the same port

  16. 16

    Sharing same port for REST endpoints and netty socket.io?

  17. 17

    Go & Socket.io HTTP + WSS on one port with CORS?

  18. 18

    How to configure Socket.io to run on same port on https?

  19. 19

    Node.js - Using Socket.io and Express on the Same Port

  20. 20

    Using node js library Socket io without port

  21. 21

    node.js+socket.io port not opening with ssl

  22. 22

    socket.io try to listen to default apache port

  23. 23

    socket.io port for every chat room javascript

  24. 24

    How to start node express, binaryserver and socket.io on same port?

  25. 25

    Run socket.io 2.0 and Express 4.0+ on the same port

  26. 26

    express app and socket.io chat in different port?

  27. 27

    which port visual studio use for web deployment?

  28. 28

    Which port to use for Network discovery application

  29. 29

    How to find which serial port is in use?

HotTag

Archive