The letter S in a light blue, stylized speech bubble followed by SpeakBits
SpeakBitsThe letter S in a light blue, stylized speech bubble followed by SpeakBits
Trending
Top
New
Controversial
Search
Groups

Enjoying SpeakBits?

Support the development of it by donating to Patreon or Ko-Fi.
About
Rules
Terms
Privacy
EULA
Cookies
Blog
Have feedback? We'd love to hear it!

Creating a simple multi-user chat with ruby

chat-to.dev
submitted
a year ago
bygorpo85totechnology

Summary

This is a project to practice some io and networking features in ruby. The server needs to be running at all times for everything to work. This has the benefit that the client computers dont need to have this source code on their computer too, they just need netcat or some alternative to connect to your service.

The chat function is designed to let users know when a new user has joined the chat. The user is added to the connected_clients array and a message is sent to the rest of the users. The chat function can also be used to tell the other users that a user has left.

If you would like to connect to it from outside your lan you will need to setup port forwarding on your router aswell as get a static ip from your isp. Also please make sure the server is running before trying to connect. If you have any issues i will be in the ruby chat.

10

6 Comments

6
justadev
a year ago
Not that it's helpful but I remember doing something like this in a high school computer class to get away with messaging friends lol
3
bambam
a year ago
I only got as far as sending a command line message to other computers lol
4
iareunique
a year ago
I used to love ruby and rails. It's seems like most have moved away from it professionally.
2
gorpo85OP
a year ago
and what language are you programming now?
2
iareunique
a year ago
I moved to Java myself, I know a lot of people moved to Python. This isn't to say it's not used anywhere, plenty of companies do, it just used to be everywhere a few years ago and now it's not.
1
gorpo85OP
a year ago*
friends, participate in the site. help us bring you better and better content. https://chat-to.dev