-
Hi forum, there's a python-flask-socket.io program which runs a web server I can access from localhost by opening Firefox at the page http://localhost:5000 I created a Windows Defender Firewall inbound rule and I also tried to completely switch off the firewall. socketio.run(app, host='0.0.0.0:5000', cors_allowed_origins='*') But the error remains the same. What do I need to do in order to reach the web server from other clients than localhost? [Edit] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Working on this on windows in Visual Studio Code. Nearly a year after above question, I finally found the solution to it: For reasons I don't remember now, I was used to start the application this way:
And since the socketio.run() call is enclosed in python's
It is not executed. The web server still worked since Flask does some magic on its own. Changing the call to
did the trick. 2nd problem: Get this to work in a debugging environment.
This one worked for me (I added the two lines after the single commented-out one). |
Beta Was this translation helpful? Give feedback.
Working on this on windows in Visual Studio Code. Nearly a year after above question, I finally found the solution to it:
Make sure that the socketio.run() call actually gets executed.
For reasons I don't remember now, I was used to start the application this way:
And since the socketio.run() call is enclosed in python's
It is not executed. The web server still worked since Flask does some magic on its own. Changing the call to
did the trick.
2nd problem: Get this to work in a debugging environment.
Here, the name check fails again because Visual Studio Code calls something called "launcher" with a bunch of …