Closed Anand-Keshavan closed 4 weeks ago
The syntax is:
import { protocol } from "socket.io-client";
console.log(protocol); // current is 5
Reference for the Socket.IO protocol: https://github.com/socketio/socket.io/blob/main/docs/socket.io-protocol/v5-current.md
Same with the underlying Engine.IO client:
import { protocol } from "engine.io-client";
console.log(protocol); // current is 4
Reference for the Engine.IO protocol: https://github.com/socketio/socket.io/blob/main/docs/engine.io-protocol/v4-current.md
I think this can be closed now. Please reopen if needed.
Describe the bug io.protocol is undefined
To Reproduce
Please fill the following code example:
Socket.IO server version: not relevant
Server
Socket.IO client version:
4.7.5
Client
Expected behavior expected the socket protocol number. As the python-socketio server returns "The client is using an unsupported version of the Socket.IO or Engine.IO protocols" This is a monrepo with different components using different versions of the socket.io client library. I need to figure out whether the library used by my component follows the correct protocol. It is bad enough that there is no way to know the version of the library programmatically.
Platform:
Additional context Add any other context about the problem here.