Java Sockets and the Internet

I created a small chat program that works flawlessly when the client and server are running on the same computer (and possibly also on the network). However, as soon as I try to connect to another computer via the Internet, the socket connection simply expires. Is it because of firewalls / routers, etc.?

And how can I connect ServerSocket and Socket over the Internet?

+5
source share
4 answers

However, as soon as I try to connect to another computer via the Internet, the socket connection simply expires. Is it because of firewalls / routers, etc.?

, . NAT: , IP- , , .

: , , . .

, , , , , , (, ) .

+4

NAT- ( , Wi-Fi), , .

IP- -? 192.168.x.x 10.x.x.x, .

+1

, , , 127.0.0.1/localhost, , - . , (.. , IP-, 192.168.xy), , .

, , , . 127.0.0.1, , . , .

. , NAT, . , - .

+1

, ; , , .

, , , IP- NAT-.

0
source

All Articles