Websocket client not connecting to the socket.io server #4299
-
I have a basic socket.io server (version 4.4.1) to which I am trying to connect with a C++ websocket client. I have even tried from Postman client using Raw Websocket client too. It shows the same behaviours with EIO=3 and EIO=4. Any pointers on what extra needs to be done on the client or server side to resolve this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
So after debugging a lot I was able to figure this out. This needs to be in the migration documentation along with the reversal of ping/pong messages. |
Beta Was this translation helpful? Give feedback.
-
I'm having this problem now. It's very confusing to me that |
Beta Was this translation helpful? Give feedback.
-
Use a websocket client instead.. socket.io prevents you from successfully
connecting. Thats what i did..
…On Thu., Jan. 16, 2025, 4:40 a.m. Sergi Mansilla, ***@***.***> wrote:
I'm having this problem now. It's very confusing to me that allowEIO3:
true doesn't prevent this. What's the point of that directive, if v2
clients can't connect to it anyway? Is there a way to prevent v4 to send
the 40 on connect?
—
Reply to this email directly, view it on GitHub
<#4299 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZCKOWU67YHXP57D4T646W32K55CBAVCNFSM6AAAAABVJFMOZKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBVGI4DAMI>
.
You are receiving this because you commented.Message ID: <socketio/socket.
***@***.***>
|
Beta Was this translation helpful? Give feedback.
So after debugging a lot I was able to figure this out.
The issue is that when using EIO v3 the server sends the CONNECT message packet. However, for EIO v4, the client has to send the CONNECT message packet.
CONNECT message packet is identified by text 40 where,
4 => engine.io packet type MESSAGE
0 => socket.io packet type CONNECT
This needs to be in the migration documentation along with the reversal of ping/pong messages.