I am trying to set up a simple webserver. This is the simplified code.
from flask import Flask
from waitress import serve
app = Flask(__name__)
@app.route("/data")
def get_data():
return {"abc"[i]:i for i in range(3)}
if __name__=="__main__":
# app.run(debug=True, host="0.0.0.0", port=8080)
serve(app, host="0.0.0.0", port=8080)
I can connect to this on my desktop and my phone (which is on my WiFi) and it works as desired.
The issue comes when a connection is attempted from a device not on my network (say a phone on a different network). The response is ERR_ADDRESS_UNREACHABLE.
I setup an inbound rule in my firewall settings. I'm on a windows 10 OS right now if that matters.
- ProtocolType=TCP (it was default)
- LocalPort="Specific Ports" and 8080
- RemotePort="All Ports"
I also read I should set up port forwarding in my router so I followed these instructions from my ISP.
- It's in the Service List
- Global Port Range is 8080-8080
- Protocol is TCP/UDP (again, default)
- Host Port is 8080
I'm not sure what else I should change.
Thanks!