I write my web services in Django, everything is OK when I test my API in postman (on http://127.0.0.1:8000/
). But when I try to use Retrofit to connect http://192.168.43.115:8000
I cannot. This is the error:
message:java.net.ConnectException: failed to connect to /192.168.43.115 (port 8000) from /192.168.232.2 (port 50628) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused
127.0.0.1:8000
in the output oflsof
means that your program is listening only on the 127.0.0.1 interface, not on 192.168.43.255.