Question

I will try to explain this as briefly as possible, I was developing an app on Android Studio, running an emulator genymotion on Vbox, after finishing everything and running the django apache server, tried it first on localhost, using localhost:8000 on a browser, and it worked fine, tried afterwards on my emulator using an httppost on my app, kept getting "org.apache.http.conn.HttpHostConnectException: Connection to http://192.148.16.9:8000 refused" (the internet permission is included)

I tried with several ips, 10.0.2.2:8000, the eth0 ip, the vbox ip (mentioned below), none worked, tried exporting the app to my phone, with several ips, and still won't work, tried accessing the server right through the browser (on phone and emulator) nothing working, the server didn't get any get or post requests except from the localhost session I did on same machine, searched for a solution in several questions here non helped, and asked elsewhere and still didn't help, I hope someone can help me, here's what I can provide, and mention if I've to provide anything else

Was it helpful?

Solution

tcp        0      0 localhost:8000          *:*                     LISTEN

Probably is not apache ( listening on 80 and 443 ) but django,

try

./manage.py runserver 0.0.0.0:8000

see manage.py runserver

then retry 192.168.56.1:8000

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top