ERPNext Development Connection refused when RestApi is called

Hi,

I am using ERPNext docker installation for development and I am using the RestAPI for creating an invoice through my mobile app. When I try to create the invoice through the Rest Api on my local docker dev environment I get the following error.

Exception has occurred.
SocketException (SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 47672)

Could someone please help me fix this issue?

If you’re using linux use 172.17.0.1 instead of localhost when you need to access services running on docker host.

For windows and mac use host.docker.internal

1 Like

Thank you so much! It is giving me a timeout and cannot login. Any solution for that? I am running this on Linux.

You won’t be able to access servers from mobile easily.

Try using some service like ngrok or localtunnel.

No idea, I’ve not faced this. I’ve not developed mobile app requests like this.