Abdullah Omar Nasseef
Abdullah Omar Nasseef

Reputation: 43

Python http.server module on Termux (Android terminal emulator app) cannot serve on local network ip address

I am trying to run:

python -m http.server --bind 192.168.xxxxx #my local network ip address

on Termux, an Android terminal emulator app.

However, I get the OSError: [Errno 99] Cannot assign requested address exception. The same code works on my computer and I can access that server from my phone's browser connected to the same network.

Serving to the localhost works, however, I need to be able to access the server created in my phone on my computer, so localhost is not enough for me (as it does not let me access the server from my computer connected to the same network).

Read somewhere that running the module on a VM does not work due to bridging issues, and tells to try pinging the local network ip address. I can ping that, which means this is not a bridging issue.

Is this some sort of security restriction by Android? I feel like that's the case, although not certain. My device is not rooted.

Upvotes: 1

Views: 1177

Answers (0)

Related Questions