Usage Docs/15to16.md
This guide will help you navigate the changes that were introduced in v16.
The client now supports socket.io 3 servers. This is mostly a transparent change, however if your server
is socket.io 2, you must send .version(.two) as an option to the manager.
SocketManager(socketURL: URL(string:"http://localhost:8087/")!, config: [.version(.two)])
allowEIO3: true)You can check the version of the connection on the server side with:
io.on("connection", (socket) => {
// either 3 for the 3rd revision of the protocol (Socket.IO v2) or 4 for the 4th revision (Socket.IO v3/v4)
const version = socket.conn.protocol;
});
See also: