Failed to connect to localhost/127.0.0.1:5000

Remon Shehatta

I am using Retrofit2 to make network requests but the endpoint is locally on my machine.

So my base URL is private val BASE_URL = "http://localhost:8000/", but it gives me this response Failed to connect to localhost/127.0.0.1:5000

So I did some search and I found out that I need to use my local IP address as the following private val BASE_URL = "http:192.168.1.15//:8000/", but then I get this response Response{protocol=http/1.1, code=404, message=Not Found, url=http://192.168.1.15//:8000/api/Home/RegisterShop}

Any idea how to solve this issue?

Onik

If you are using an Android emulator, the IP address of the host machine would be 10.0.2.2.

So in your case it'd be http://10.0.2.2:8000/.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

org.apache.http.conn.HttpHostConnectException: Connect to localhost:19538 [localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)

java.net.ConnectException : Failed to connect to localhost/0:0:0:0:0:0:0:1:1731 using ChromeDriver Chrome through Selenium Java in Spring Bot

Zabbix HTTP agent 0 then Failed to connect

certificate Error SSL_connect returned=1 errno=0 state=error: certificate verify failed

zookeeper unable to open socket to localhost/0:0:0:0:0:0:0:1:2181

Connection refused: localhost/0:0:0:0:0:0:0:1:9000 with gRPC

Module parse failed: Unexpected character '@' (1:0)

IntelliJ - Failed to start: 0 passed, 1 not started

Ruby rails paperclip Seahorse::Client::NetworkingError (SSL_connect returned=1 errno=0 state=error: certificate verify failed)

expo build:ios throws Reason: Unknown reason, raw: "SSL_connect returned=1 errno=0 state=error: certificate verify failed"

SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed MAC

code igniter - Failed to connect: 0 while sending ios notifications

Build failed with message “processF0F1DebugResources FAILED”

Using a function I made to conduct six tests from 5000 datasets of N(0,1)

Traffic from one interface to another (wlp3s0b1 > ppp0) on port 8080 and 5000

"POST http://localhost:5000 net err failed"

./startFabric error - endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded

The creation of swap space in partition #3 of SCSI1 (0,0,0) (sda) failed

perl 5.28.x compilation: Failed test 'timelocal year for 1970 1 2 0 0 0'

IPv6 loopback address http://0:0:0:0:0:0:0:1 - browser can't connect. Method getRemoteHost()

IOException java.net.ConnectException: failed to connect to /127.0.0.1(port 5000):connect failed:ECONNREFUSED(Connection Refused)

Python - 0**0 == 1?

React JS: ERROR in index.css 1:0 (Module parse failed: Unexpected token (1:0))

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ONLY WHEN PROXYING

Google Oauth SSL error - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Heroku Rails Net::HTTP: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

IllegalStateException: get field slot from row 0 col -1 failed

TypeError: Failed to execute 'item' on 'HTMLCollection': 1 argument required, but only 0