[Vuejs]-Websocket connection fails while socket.io works fine

0👍

You don’t state what type of server your using, but since connecting with the socket.io client works, I guess your server probably uses socket.io.

And as the socket.io documentation states:

Socket.IO is NOT a WebSocket implementation.

And

a WebSocket client will not be able to successfully connect to a Socket.IO server

Socket.io is a library with a server and client side implementation, which uses WebSockets, but has a lot of features that make implementing real time connections easier.

So it seems like you have to use the socket.io client (although I understand this is a problem for you), or change the server implementation to a pure WebSocket implementation.

Leave a comment