简体   繁体   中英

Java TCP/IP Chat Room, how to make it work over internet

I have fully developed a chat room for multiple clients with multi-threaded server which does the job, however only on my local machine. I want to go beyond this, and make this chat room to be working over the internet. So far I have made the port forwarding on my router for TCP protocol to route to my local IP address, however this didn't solve the problem and I still can't connect the client, even on my own local network. What other steps should I follow to get my chat room working on my own local network and then the internet?

尝试禁用(Windows)防火墙?

So my friend the basic rule for make anything to work over internet is to do Port forwarding or in simple way you can say that to open your server for the public network. For that you need to make sure that the routing path is complete from internet machines to your desktop. For this to work you need to open the port for which you need to access your machine from firewall settings, and also ensuring that trafic is routed from your public IP address to the server's IP as your server will be private under some router or ISP.

Way to do that:

  1. You need to configure your home network ie router setting. So in your router, configure the port you want the communication to happen(say port 5443).
  2. In your router, configure a port-forward for the port 5443 to the internal IP address of your actual server, also to port 5443. Reference: https://www.noip.com/support/knowledgebase/general-port-forwarding-guide/
  3. On your server(your Desktop Machine) ensure that your firewall settings for port 5443 is on and set to allow rather than block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM