can I use socket.io-client to connect to a standard websocket?

前端 未结 2 1425
野的像风
野的像风 2020-12-03 03:09

Trying to use socket.io-client to connect to a websocket server that is written in Go. I\'ve successfully connected using the node WebSocket library (npm). So the working We

2条回答
  •  春和景丽
    2020-12-03 03:44

    Not sure if this was the case at the time, but socket.io's website now states this directly in the docs.

    Although Socket.IO indeed uses WebSocket as a transport when possible, it adds additional metadata to each packet. That is why a WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a plain WebSocket server either.

    https://socket.io/docs/

提交回复
热议问题