by hyperpallium · 9y ago · 0 comments
python3 -m http.server
http://localhost:8000/ # on phone
However, I haven't been able to access a server running on termux on my phone from anywhere else. I suspect servers are blocked by my mobile ISP (makes sense!), but I never got to the bottom of it.Should work over wifi though.
Many mobile ISPs run NAT, you don't even get a public IP of your own during the session, just an internal one.
Alternatively, you can DIY by connecting to some other machine using SSH and establishing a reverse tunnel.
python -m http.server 0.0.0.0:8000
That should allow you to access it externally.Edit:
Works if you just run:
python3 -m http.server
Thanks for the helpEdit[1]:
Works great with python's built in web server but wont work with flask's built in development web server.