I am working on a chatroom full-stack web app with Python Flask SocketIO, where users can join a room with a provided code and chat together. The app works fine on my local machine, but it doesn’t work properly on Heroku cloud hosting. The site itself loads, but I can’t send or receive messages and I can’t join a room. My Procfile is web: gunicorn main:app and my dynos are ON.
I have checked the Heroku logs and I don’t see any errors or warnings, except for this one:
2023-07-04T16:19:42.900500+00:00 heroku[router]: at=info method=POST path="/socket.io/?EIO=4&transport=polling&t=OaXiznU&sid=MIsCs0Lw4Lb8iv5NAAAL" host=chatroom-x-2e63fe953441.herokuapp.com request_id=868202a9-710d-46c0-8c32-886089caa34e fwd="216.243.35.108" dyno=web.1 connect=0ms service=1ms status=200 bytes=275 protocol=https
I am not sure what this means or if it is related to the issue. I am new to SocketIO and Heroku, so I might be missing something obvious.
- I have tried to use a different Procfile setup, such as
web: gunicorn -k flask_sockets.worker app:app, but the build will not come up and crash on Heroku.
Does anyone know what could be causing this issue and how can I fix it? Any help or suggestions would be greatly appreciated. Thank you.