Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what are EIO=3&transport=websocket in websocket url

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

like image 578
Janier Avatar asked Dec 03 '17 16:12

Janier


People also ask

How is WebSocket different than HTTP?

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.

Is WebSocket a protocol?

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].


1 Answers

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.

like image 57
jfriend00 Avatar answered Oct 12 '22 17:10

jfriend00