1
1
I have a REST service running on Mac OS X, which im currently accessing using "localhost:8888" and "10.0.2.2:8888"
I want to access the same service from another computer which is in the same network.
I disabled the firewall also and I typed
nc -v 192.168.1.3 8888
and got the result as
nc: connectx to 192.168.1.3 port 8888 (tcp) failed: Connection refused
currently i use localhost (to access using java application) and 10.0.2.2 (to access using android application runs in the simulator) which both runs on the same machine which the server runs too.
I want to put the android application to my phone and give the machine ip addess ( because if i connect to internet via wifi, it'll be in the same local area network) i should be able to access my service runs on my machine.
can some one please tell me what im doing wrong here? Thank you
what is the IP address of the machine running your webserver? (run ifconfig from the command line if you aren't sure). – Catherine MacInnes – 2015-01-16T22:02:29.907
its 192.168.1.3 – Ramindu De Silva – 2015-01-17T02:15:13.210
You'll need to configure your "server" to listen on all IPs. E.g. if Apache is configured to listen to
127.0.0.1:80
then that is all it will respond to (localhost). Your server may have a configruation to change to, say,0.0.0.0:<port>
or:<port>
to imply everything. You should also consider looking at any firewall rules. – Kinnectus – 2019-02-20T12:32:28.817