Should I Set Up a Server for Exchanging TCP Messages Over the Internet?
Asked by
CoolCoder23
Hey everyone! I've been dabbling in software development for a few years, mainly in a niche area, and I'm not super knowledgeable about internet protocols and servers. I created an application that exchanges TCP messages on a local network, where each instance runs as a server on one port and a client on another. Now, I'm looking to expand this app so users can connect over the internet instead of just a LAN. Ideally, I want to implement a system where users can log in and create rooms to exchange messages, syncing their projects together. However, I need advice on how to approach this. What exactly do I need to look into? Is it really necessary to set up a server? Which services would you recommend, and what topics should I study? I'm quite the novice in this area, so I appreciate any guidance! Thanks!
Answers
Have you checked out NATS? Itโs a fast and secure pub/sub system that lets clients listen to topics and send messages securely over the internet. It has clients for almost any programming language, including Lua. Plus, you can host servers in the cloud or on your local machine. Definitely worth a look!
Reply to this answer
Consider using a message broker like RabbitMQ or MQTT. They handle message management, and you can monitor the messages effectively. These tools usually support SSL for secure connections too. There are a ton of resources out there for getting started with them!
Reply to this answer
You might want to look at IRC protocols. Theyโre fairly well-documented and could provide you with a robust framework for real-time messaging. Hereโs a link to the wiki for some background: https://en.m.wikipedia.org/wiki/IRC
Reply to this answer
WebRTC might be the route to consider. Although it's quite complex, itโs supported by nearly all web browsers and works seamlessly over public networks, even passing through firewalls, which is a big win for your app. Youโll need STUN/TURN servers, but many providers offer free tiers to get started. Alternatively, building something with Node.js and Express could also work well for socket connections!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions