wss://www.mysite.ca/socket.io/?EIO=3&transport=websocket
This is how chrome webdevoloper tools shows the request url of a socket io.
I am trying to understand more about EIO=3&transport=websocket .
I have to invoke the url from an API tool
Unlike HTTP, where you have to constantly request updates, with websockets, updates are sent immediately when they are available. WebSockets keeps a single, persistent connection open while eliminating latency problems that arise with HTTP request/response-based methods.
1.7. The WebSocket protocol is an independent TCP-based protocol. Its only relationship to HTTP is that its handshake is interpreted by HTTP servers as an Upgrade request. By default the WebSocket protocol uses port 80 for regular WebSocket connections and port 443 for WebSocket connections tunneled over TLS [RFC2818].
These are query parameters that the socket.io client sends to the socket.io server as part of the initial connection request.
EIO=3
, I believe, is the version number of the engine.io sub-system in socket.io. If the server is not compatible with this version number, it will likely fail the attempt to connect.
transport=websocket
says that socket.io wants to use the websocket protocol as the eventual transport. socket.io has several different transports it supports including web polling and a flash-based protocol.
To connect to socket.io server, you will need a full-fledged socket.io client. You can't make a socket.io connection by just sending a URL from a tool to the server. There's a lot more involved than that in establishing a working socket.io connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With