I have a simple chat written in java. I launched the server for it on Linux, and the client connects from a computer to windows. If I enter a local ip to connect to ServerSocket, then everything works, but if I try to connect via the Internet using an external ip and another computer, the connection does not work. (there is still a site on the server that can be opened via external ip). Tell me, is it even possible to connect to such a chat via the Internet?

  • With what parameters did you open the socket on the server? I could be wrong, but if I specify it as localhost, the server will not be visible on the network. Need to create using an empty constructor - Serhii Dikobrazko
  • If the local chat via the socket works normally, but on the remote server it does not - most likely, it is impossible to establish a connection with serverIp:serverPort . Maybe there is no network, maybe it blocks the firewall (incoming connection or the server socket itself) - this is already a must see. - Regent

1 answer 1

You must have ports routed to the server with a chat on the router. You can read about port forwarding here: http://www.dlink.ru/u/faq/246/1156.html

  • Added redirection in the router and it all worked! - Maxim Freud