4 ms·
I installed this months ago and cant figure out how to access localhost through my browser. I wrote a sample flask app and ran it but cant access it outside of
by pryelluw 9y ago
I installed this months ago and cant figure out how to access localhost through my browser. I wrote a sample flask app and ran it but cant access it outside of termux. Is there a way to do so?
- deleted 9y ago[deleted]
- hyperpallium 9y agopython3 -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.
- npolet 9y agoI tend to run: python -m http.server 0.0.0.0:8000 That should allow you to access it externally.
- pryelluw 9y agoJust tested it and wont work. Edit: Works if you just run: python3 -m http.server Thanks for the help Edit[1]: Works great with python's built in web server but wont work with flask's built in development web server.
- icebraining 9y agoI suspect servers are blocked by my mobile ISP (makes sense!), but I never got to the bottom of it. Many mobile ISPs run NAT, you don't even get a public IP of your own during the session, just an internal one.
- hyperpallium 9y agoThanks! Is there a way to do it? It must support bi-dir streams, they just need to be initiated from the phone.
- icebraining 9y agoYou can use a tunnel like https://pagekite.net/ https://pagekite.net/ it seems they support Android. Alternatively, you can DIY by connecting to some other machine using SSH and establishing a reverse tunnel.