socketio / socket.io-client-swift

Other
5.21k stars 839 forks source link

Use correct default socket path. Use native engine of StarScream #1483

Open Crysis21 opened 5 months ago

Crysis21 commented 5 months ago

I've been debugging in the past 2 days why the socket.io is not working connecting with our backend. Android was working fine, but iOS seems to be stuck with no explanation. I managed to get it working and some of the reasons are these:

  1. the default socket.io path is encoded to engine.io whereas the correct one is socket.io as specified in the docs. This definely made a lot of people not understand what is happening and probably the issues opened in the past few days, can relate to this.
  2. from what I tested, the default implementation of starscream uses custom ws engine by default. however, this doesn't seem to work great with our backend and using the native engine seems to be doing a great job.
  3. there is no logging of the WS events and error logs are not handeld at all. For this reason, we had no idea that we were getting a 404 when the upgrade request was being made.