Issue
Dear smart people of stackoverflow,
I know this question has been asked a lot here but none of the posted solutions have worked for me as of yet. Any help here would be much appreciated:
The Problem: Cannot connect to flask app server from other devices (PCs, mobiles) on the same network. (in other words: localhost works perfectly but I cannot connect from external device)
What I've Tried:
1) Setting app.run(host='0.0.0.0', port=5000, debug=True, threaded=True)
in the app.py so that the server will listen on all available network interfaces.
2) Enabling TCP traffic for port 5000 in local network in Windows Defender Firewall (with inbound and outbound rules added)
3) Using my host PC's IPv4 address in the URL bar of my external device's browser in the following format: http://<host_ipaddress>:<port>/
4) Using my host PC's hostname in the URL bar of my external device's browser in the following format: http://<host_name>:<port>/
5) Running the app.py file from Windows Powershell and Python (.py) Executor
None of these solutions has worked so far, even after attempting to connect from a few different external devices. Thanks in advance for your help!
Solution
I solved the issue by changing my home network profile to private instead of public, which allows my PC to be discoverable. Completely overlooked that!
Hope this helps someone!
Answered By - rmd_po
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.