How to connect to my http://localhost web server f

2018-12-31 05:18发布

What can I do in Eclipse's Android emulator to connect it to my localhost web server page at http://localhost or http://127.0.0.1?

I've tried it, but the emulator still takes my request like a Google search for localhost or worse it says that it didn't found the page while my web server is normally running.

10条回答
谁念西风独自凉
2楼-- · 2018-12-31 06:09

If you are in windows you can go to simbol system and write ipconfig and check what ip is assigned to your machine.

查看更多
孤独总比滥情好
3楼-- · 2018-12-31 06:09

I needed to figure out the system host IP address for the emulator "Nox App Player". Here is how I figured out it was 172.17.100.2.

  1. Installed Android Terminal Emulator from the app store
  2. Issue ip link show command to show all network interfaces. Of particular interest was the eth1 interface
  3. Issue ifconfig eth1 command, shows net as 172.17.100.15/255.255.255.0
  4. Begin pinging addresses starting at 172.17.100.1, got a hit on `172.17.100.2'. Not sure if a firewall would interfere but it didn't in my case

Maybe this can help someone else figure it out for other emulators.

查看更多
荒废的爱情
4楼-- · 2018-12-31 06:12

I do not know, maybe this topic is already solved, but when I have tried recently do this on Windows machine, I have faced with lot of difficulties. So my solution was really simple. I have downloaded this soft http://www.lenzg.net/rinetd/rinetd.html followed their instructions about how to make port forwarding and then successfully my android device connected to make asp.net localhost project and stopped on my breaking point.

my rinetd.conf file:

10.1.1.20 1234 127.0.0.1 1234
10.1.1.20 82 127.0.0.1 82

Where 10.1.1.20 is my localhost ip, 82 and 1234 my ports Also I have craeted bath file for easy life yournameofbathfile.bat, put that file inside rinedfolder. My bath file:

rinetd.exe -c rinetd.conf

After starting this soft, start your aps.net server and try to access from android device or any device in your local network(for example Computer ABC starts putty) and you will see that everything works. No need to go to router setting or do any other complicated things. I hope this will help you. Enjoy.

查看更多
旧时光的记忆
5楼-- · 2018-12-31 06:13

For My Mac OS mountain Lion device :

http:// 10.0.2.2:8888

Works perfect !

查看更多
登录 后发表回答