Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GET /socket.io/?EIO=3&transport=polling&t=MniHjPM HTTP/1.1

I have a simple Flask chat application that I am testing out coming from a tutorial. Supposedly I just need to run it using the "python app.py" command but when I access it via http://localhost:5000 i get a continuous message of this:

Console

I was hoping to get 200. I have Flask, Flask-SocketIO, and eventlet already installed. Any idea that can point me in the right direction? Thank you.

like image 751
siopaoman Avatar asked Dec 17 '22 16:12

siopaoman


1 Answers

The current release of Flask-SocketIO has stricter requirements with regards to cross-origin requests. adding cors_allowed_origins='https://localhost will resolve the error.
i.e. SocketIO(app,cors_allowed_origins="http://localhost") or
SocketIO(app,cors_allowed_origins="*") hopefully this work.

like image 182
Mamun Avatar answered Dec 28 '22 09:12

Mamun