Hacker News new | past | comments | ask | show | jobs | submit login

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?



  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.


I 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.


Thanks! Is there a way to do it? It must support bi-dir streams, they just need to be initiated from the phone.


You can use a tunnel like 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.


I tend to run:

    python -m http.server 0.0.0.0:8000
That should allow you to access it externally.


Just 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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: