HTTP request from device to local server

I’m developping a connected application with Ionic.
So, I have a local webservice running on my computer (http://localhost:8100/xxxx)
In my app, I make call to this webservice :

  • this works when I launch the app with ionic service
  • this doesn’t work when I launch the app on my android device (with ionic run and ionic run -l)

It’d be cool if you could help me.

can you even access it via phone ? I think its a problem with your network settings :smile:

No, when I run it on a phone, it doesn’t work.
THat’s what I was thinking. As the host of the api requests is localhost, the phone make call locally, not on my computer.
How to call the server which is on my computer ?

@ebikhafan is half right, but the problem will be because your phone is trying to access http://localhost - it doesn’t know what this is, get your IP address of your computer and replace localhost with it, this will allow your phone to access the resources.

Also look into using ionic proxy

1 Like

yes :)) I forgot to mention :)) thanks
In linux you should just change the address to http://your-local-ip:8100/xxxx
in windows (at least for me) I had to change some network settings

Hello friend, tell me how you did it to connect to your web service. Could you please teach me? is that I have been trying and I have not yet achieved it. is my mail in case you share your code with me. Thank you.


  1. Connect the Mobile and your Computer to the same network/wifi.
  2. find your system(computer) IP.
  3. while taking the mobile build in the config file change the http://localhost:8100/ into http://YOUR_IP:8100/ eg: (

Now you can access your local server form your mobile.


Exactly what I wanted to thank you @diargal
So in step 3 what you meant was to start ionic serve like

ionic serve --address=

and from my iPhone just go to
now I can test my ionic web app (PWA) from iphone