SlightlyCultured
SlightlyCultured

Reputation: 333

Cannot access simple server locally, but can access externally

So I'm in the process of learning to make an android app, and will require a server to get information from. I have created a simple server that just listens on port 65431 for connections and once a connection is established, just writes out a line of text.

The problem is, I can test the server from an external network and it all works fine, however, when I test it from my local network, it doesn't.

What I mean by local network:

  1. Server on Macbook IP 192.168.5.111 (not DHCP, statically assigned by router)
  2. Have a static IP from ISP
  3. Trying to test server from phone connected to home Wifi IP 192.168.5.101
  4. When testing localhost, it works, but not to static IP

When I test from my phone, there is no connection made. Any thoughts?

Upvotes: 4

Views: 294

Answers (1)

James Jithin
James Jithin

Reputation: 10555

Your server would be bound to the static IP what you've mentioned. Set the server to run on IP 0.0.0.0 and all done.

Test the access with following command on server:

telnet <ip-address> <port>

Upvotes: 2

Related Questions