Python Forum

Full Version: [Socket] Can a server be accessible from devices not in the same network?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I assume that it has to do with the port and host of the Socket server, and if so, then what host and port can I choose so that devices not just in a local area are able to access the server? Thanks in advance for any help.
Yes.

If host A has 192.168.0.10/24 and host B has 192.168.0.11/24 they can communicate.
The 24 is the shortcut for subnet mask: 255.255.255.0, 24 bits are set to 1, host part is 8 bit, so you've 255 - 2 hosts available in the network 192.168.0.0/24.
If you have a server in a data center with a fixed ip address, your devices can connect to your server.
If you try to connect two different networks via internet, you need a tunnel/vpn.
If you try to connect two different networks without internet, you need a router, which acts as a gateway between the two networks.

You should give us more context to answer.