1

I have an Echoprint local webserver (uses tokyotyrant, python, solr) set up on a Linux virtual machine.

I can access it through the browser or curl in the virtual machine using http//localhost:8080 and in the non-virtual machine (couldn't find out how to say it better) I use the IP on the virtual machine also with the 8080 port.

However, when I try to access it through my android on the same wifi I get a connection refused error.

Cœur
  • 37,241
  • 25
  • 195
  • 267

4 Answers4

0

If you are referring your localhost on your system from the Android emulator then you have to use 10.0.2.2:8080. Because Android emulator runs inside a Virtual Machine(QEMU) therefore here 127.0.0.1 or localhost will be emulator's own loopback address.

Refer: Emulator Networking

joselufo
  • 3,393
  • 3
  • 23
  • 37
  • I don't know if it makes a difference or not but I'm using an actual android device. I have already tried to use that address and I still get the connection refused error. Could it be that the ports are closed even if I'm doing everything in the same wifi? – RicardoDeus Jul 03 '14 at 15:32
0

Is the server bound to localhost or 0.0.0.0?

Maybe your host resolves that ip to some kind of a localhost as well, due to bridging.

0

Both "localhost" and "127.0.0.1" are local loopback interfaces only: they only make sense within the same machine. From your Android device, assuming it's on the same wifi network as your machine, you'll need to use the actual IP address of your main machine: you can either find that from the network settings of that machine, or from your router's web interface.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
0

In case someone has the same problem, I solved it. The connection has to be by cable and on the VMware Player settings the network connection has to be bridged, also you must click "Configure adapters" and uncheck the "VirtualBox Host-Only Ethernet Adapter".