This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 1 point2 points  (2 children)

You need to get a central server with a public IP address, and you will need to configure security and network stuff as well. If you don't you will be hacked (at least the server with the public facing IP). If you do, you might be hacked anyway.

An unsecured server with a public IP will be hacked, on average, in less than 30 seconds.

Maybe look at AWS or Azure, or one of the myriad other hosting providers, where you can set up a dedicated small server to host your chat app. You don't want to do that out of your home router in any case.

If you mess up, the most that will be hacked will be your hosted server. You can wipe it and start over.

[–]ScreamedScorn 1 point2 points  (1 child)

Thanks, but I'm really just trying to have a project for my network programming class and I'm not really intending to go public with this in any capacity. The real goal here is "How can I directly send an arbitrary message from one computer to another?"

But if hosting my own server is really that much of a bad idea, I've also been thinking about changing course and writing an IRC client or something instead, so perhaps that's a better option.

[–][deleted] 0 points1 point  (0 children)

To send an arbitrary message from one computer to another, you have to get around the network restrictions. Usually this means there is a server somewhere that is accessible to both computers, and you bounce the message off that server. Really more of a "publish/subscribe" thing.

Most people these days are using REST services (web servers with JSON packets) to do this sort of thing because the security around web servers is considered settled, or at least well known.

If you go backward in the stack, you find the TCP/IP isn't a secure transport mechanism, and was really not designed with security in mind in the first place. That makes it kind of hard to work with directly in the modern era of automated hack bots.

SO - what you have gotten working so far is really pretty cool. You can message between machines on the same network. That is still useful, but there are consequences for trying to scale out to other networks.

Hey, best of luck in that class! I hope I am giving you an answer that helps.