Skip to content
← Back to Community
C++ Chat Room!
Profile icon
CSharpIsGud

A chat room server written in C++!

Doesn't use websockets, I could not find a good websocket library that didn't require tons of dependencies like openssl.
So instead of websockets it uses https://repl.it/talk/share/HTTP-Server-Library-in-C/32702 and polls the server for new posts.

@MrEconomical I told you I would do it :)

https://chat--csharpisgud.repl.co/

Voters
Profile icon
caly1687
Profile icon
z80
Profile icon
programmeruser
Profile icon
chippycoder08
Profile icon
CodeSalvageON
Profile icon
xxpertHacker
Profile icon
mkhoi
Profile icon
Navinor
Profile icon
Coder39182
Profile icon
AgastyaSandhuja
Comments
hotnewtop
Profile icon
Description

Whoa... I need to learn from this guy.

Profile icon
xxpertHacker

@Description Don't we all?

Profile icon
MrEconomical

incredible

Profile icon
chippycoder08

Does it show usernames? Like who said the thing that was just entered into the chat? Because when I went in and tested it, it didn't ask me for a name. Other than that, this is really cool!

Profile icon
xxpertHacker

Umm... the Repl doesn't work, are you updating it right now?
Also, I remember finding out how to use C++ WebSockets, if I find the tutorial, I'll try to link it here.

Profile icon
CSharpIsGud

@StudentFires I know how to use websockets in C++, but getting a lib to work on replit is another story.

I think its a problem with replit but sometimes I have to keep running it until it works for some reason

Profile icon
xxpertHacker

@CSharpIsGud I really can't get your Repl to start properly, all it shows is the we couldn't reach your Repl image.

Might I recommend more terminal output for better debugging?

Profile icon
CSharpIsGud

@StudentFires You have to start it multiple times until it runs correctly, I don't know why replit cant reach it when it is running

Profile icon
xxpertHacker

@CSharpIsGud Oh, it barely started working.

Profile icon
CSharpIsGud

@StudentFires yeah no idea why replit does it

Profile icon
xxpertHacker

@CSharpIsGud Are you absolutely, 100% sure it's Repl? Like yeah, I'm not seeing it throw any errors, I don't see any segmentation faults, nor do I think you caused any stack corruption (I'll compile with stack safety) but still, are you 100% sure everything is running as intended? This is why I suggested more terminal output. If I have time I'll try to do this myself.

Profile icon
CSharpIsGud

@StudentFires Yes im 100% sure, it always gets the first request. The rest are like any other request except replit doesn't let them get through

Profile icon
xxpertHacker

@CSharpIsGud Repl's firewall?

Profile icon
CSharpIsGud

@StudentFires a firewall wouldn't let it work at all, it can still serve pages

Profile icon
xxpertHacker

@CSharpIsGud Report this to the Repl development team? Go to the bugs section?

Profile icon
Coder39182

Nice, I don't understand how it works... But still, nice.

Profile icon
AgastyaSandhuja

can't find repl but it sounds good

Profile icon
CSharpIsGud

@AgastyaSandhuja it segfaults randomly sometimes

Profile icon
AgastyaSandhuja

found it! @CSharpIsGud

Profile icon
ChezCoder

very awesome!

Profile icon
Roar123

Nice! Maybe add some margin between the left side and text so it's easier to read

Profile icon
Highwayman

require tons of dependencies like openssl.

OpenSSL is already on repl.it. There are actually a bunch of surprising things on repl.it if you look, so It might not be as bad as you think....

Profile icon
CSharpIsGud

@Highwayman and boost

Profile icon
Highwayman

@CSharpIsGud huh I never noticed the boost... that’s actually quite nice XD

Profile icon
CSharpIsGud

@Highwayman I meant the libs needed boost for some things but if the repls come with boost thats great

Profile icon
Highwayman

@CSharpIsGud yes it does, XD seems we’re both learning things today lol.

Profile icon
xxpertHacker

@Highwayman Boost is great! But can be hard to learn if taught wrong, or you're not looking at it correctly.

Profile icon
Highwayman

@StudentFires I generally don’t think much about boost. All the solutions that I’ve found that use boost I generally end up solving using just the normal language features. I’ll probably learn it at some point, but right now I can’t find anything to motivate me enough lol.

Profile icon
xxpertHacker

@Highwayman Using to make a server. I've seen good use cases, but I forgot what they were of course. Also, boost was made using the normal language, it's not magic.

Profile icon
Highwayman

@StudentFires of course I’m not saying that it’d be terrible to learn it or anything, I just haven’t really felt like it.

Profile icon
AdriaDonohue

its kinda glitchy,but good job dude!:)