Socket io connects multiple time when the server is hosted live #4572
-
I am not able to figure out the error. This only happens when the server is hosted on Vercel/Heroku. But when I run it locally there is no error. Kindly help me out!!! Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
your cros setting as Besides, if your client does not send cross-site requests, you don't need to set |
Beta Was this translation helpful? Give feedback.
-
Hi! The Vercel platform does not support WebSocket connections: https://vercel.com/guides/do-vercel-serverless-functions-support-websocket-connections Please note that since most serverless platforms bill by the duration of the request handler, maintaining a long-running connection with Socket.IO (or plain WebSocket) is not recommended. |
Beta Was this translation helpful? Give feedback.
Hi! The Vercel platform does not support WebSocket connections: https://vercel.com/guides/do-vercel-serverless-functions-support-websocket-connections
Please note that since most serverless platforms bill by the duration of the request handler, maintaining a long-running connection with Socket.IO (or plain WebSocket) is not recommended.