Home > front end >  Port forwarding local server to Expo android emulator
Port forwarding local server to Expo android emulator

Time:06-28

I have a local server running in my laptop. I want to access it via localhost in the android emulator. How can I do this?

CodePudding user response:

You can access host machine from inside the android emulator by going to the address 10.0.2.2 inside the emulator.

For example if you have a web service accessible on localhost:8080 on your local machine, you can access the same by typing

http://10.0.2.2:8080 

from inside the emulator. More details about emulator networking you can read in the official documentation

  • Related