Acessing website on localhost with emulator

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Acessing website on localhost with emulator

Postby misterbo » Wed Jan 02, 2008 3:51 pm

Hello ...

I am trying to access a website on my local server from the Android emulator: http://localhost:5000/test.html

The Android browser replies "Network error: Error 80 connection refused"

Is there a workaround available which enables the emulator to access local pages?

Thanks in advance for your help.

Best,
misterbo
misterbo
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Dec 31, 2007 4:13 pm

Top

Postby rtreffer » Wed Jan 02, 2008 5:42 pm

Your emulator has it's own network stack. With lo/127.0.0.1 - so localhost won't work as you try to connect to a serversocket on the emulator. Connection refused is quite logical if the port isn't open ;)

Try to access http://<your_computer_ip>:5000/test.html - this should work. If you don't have an IP simply configure eth0 or your wired network adapter with a static ip - preferable 10.X.Y.Z or 192.168.X.Y. Hope this helps.
root@localhost# : ( ) { : | : & } ; :
rtreffer
Junior Developer
Junior Developer
 
Posts: 15
Joined: Fri Nov 23, 2007 4:14 pm

Postby misterbo » Wed Jan 02, 2008 6:38 pm

It works!

Thank you very much.

Cheers,
misterbo
misterbo
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Dec 31, 2007 4:13 pm

Top

Return to General

Who is online

Users browsing this forum: No registered users and 6 guests