Python Forum
[Socket] Can a server be accessible from devices not in the same network? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: [Socket] Can a server be accessible from devices not in the same network? (/thread-27536.html)



[Socket] Can a server be accessible from devices not in the same network? - SheeppOSU - Jun-10-2020

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.


RE: [Socket] Can a server be accessible from devices not in the same network? - DeaD_EyE - Jun-10-2020

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.


RE: [Socket] Can a server be accessible from devices not in the same network? - DeaD_EyE - Jun-18-2020

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.