Share your repls and programming experiences

← Back to all posts
C++ Chat Room!
h
CSharpIsGud (549)

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/

Commentshotnewtop
Description (3)

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

oignons (306)

Amazing! never thought that this could be made with c++

#C++Gang

Highwayman (1340)

@ipastrano :P yee ok now you have to make some networking related thing in C++ XD

oignons (306)

@Highwayman oop. Nuts.
#C++NetworkingGang

chippycoder08 (16)

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!

xxpertHacker (382)

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.

CSharpIsGud (549)

@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

xxpertHacker (382)

@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?

CSharpIsGud (549)

@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

xxpertHacker (382)

@CSharpIsGud Oh, it barely started working.

CSharpIsGud (549)

@StudentFires yeah no idea why replit does it

xxpertHacker (382)

@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.

CSharpIsGud (549)

@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

CSharpIsGud (549)

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

xxpertHacker (382)

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

JoeyRueff (24)

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

AgastyaSandhuja (149)

can't find repl but it sounds good

Roar123 (431)

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

Highwayman (1340)

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....

Highwayman (1340)

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

CSharpIsGud (549)

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

Highwayman (1340)

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

xxpertHacker (382)

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

Highwayman (1340)

@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.

xxpertHacker (382)

@Highwayman Using <boost> 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.

Highwayman (1340)

@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.

AdriaDonohue (57)

its kinda glitchy,but good job dude!:)