Macos – Access localhost ( running on Mac OS X ) from another machine in the network

localhostmacosnetworkingwebserver

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

Best Answer

Type 192.168.1.3:8888/rest/getDetails on other computer. Replace rest and getDetails with your request mappings. You do not even need to fiddle with firewall. I am running a Restful app in Java on Mac and able to access on other networked computers.

Related Question