简体   繁体   中英

can't connect to the server inside emulator from outside localhost

I have a server running inside and android emulator listening in port 8080.

after the port forwarding i was able to connect to the server via my web browser "from the host(my real os)", but only if i put 127.0.0.1:8080, the problem is i can't connect if i put 192.168.1.12:8080 which is my LAN address.

some explication and how to fix it please.

other way to explain the problem: i'm in USA running a server inside my android emulator, i want some one from japan,canada...to be able to access and connect to it. or i want my second laptop to access to my server in first laptop which is the same network.

resolved,

the thing is that adb accept connection only from 12.0.0.1 no thing else.

so i install android in virtual-Box and redirect connection from 192.162.2.101 "my lan ip address" to 10.0.2.10 "android ip address in the emulator"(i do that in the virtual-box network UI".

and every thing work well.

adb "google emulator" is designed to be used/access in single host.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM