Closed fahadpf closed 3 years ago
Can you change transport to WebSocket only and recheck the issue?
@fahadpf Hi! Unfortunately, your example is not runnable as is, could you please try to reproduce by forking the fiddle here?
Can you change transport to WebSocket only and recheck the issue?
@anshulnegitc this is already the case with transports: ['websocket', 'polling']
Hey @darrachequesne, I'm not sure what exactly was my issue with this scenario. My server was actually running inside a Docker container behind a reverse proxy (Nginx). When I restarted my MacBook and restarted my Docker container, this issue didn't appear again.
I shall surely try to reproduce this issue if I ever face it again.
Describe the bug If I turn off my WiFI for a second and then turn it ON again, my
socket.io-client
gets stuck in some kind of connection and disconnection loop. I can see the console logs for successful reconnection but then suddenly my connection closes with the reason "transport close". After this, reconnection attempts are again started. I have attached a screenshot from my browser console here:At first, I thought that this might be some server issue because I first encountered this issue when I restarted my socket server. My connected clients became unable to connect with this restarted server and there started a never-ending loop of connections and disconnection. When I tried to debug the issue, I found out that my handshake requests were being allowed but my request was not going any further. Here is the screenshot of my server logs:
To Reproduce
Please fill in the following code example:
Socket.IO server version:
4.1.2
Server
Socket.IO client version:
4.1.2
Client
Then, in my Vue.js main app, I subscribe for socket emits as described in Vue-Socket.io package documentation:
Everything works as expected until I switch my network.
Expected behavior The socket client should automatically be connected to the server as soon as it comes online. This was the behavior before upgrading to v4 (v2.3.1)
Platform:
Additional context My socket.io client is reconnected when I refresh my webpage. But since I'm working on a SPA, reloading the page again and again does not seem to be a nice solution. Kindly suggest is this really some issue or am I missing something very important as I have been stuck on this issue for 2 days now. Thanks!