Search code examples
flaskflask-socketio

Socket connection is closed every minute


I'm configuring a Flask-SocketIO server.

When locally connecting a socket (http://127.0.0.1:5000), it's normally working. But after deploying it into my GCP virtual machine, sockets connected over https are closed and reconnected every minute as shown below (looks like socket connection requests are timed out at this interval).

Dev console screenshot

I've already tried with all async modes, including eventlet, gevent, and threading as well as gunicorn and uwsgi. Some configurations allow a 2-min timeout but no approach resolves the issue fundamentally.

How can I solve this?


Solution

  • Read this topic its because of the Google loadbalancer

    Br