5 comments

[ 1237 ms ] story [ 730 ms ] thread
There's a few hundred people in the "private" chat that I just generated...
Seems like a functional chat system, but it seems too simple to be of any use for a web application, with the whole thing being held in-memory.

Try adding your disposable rooms to my chat app, which has direct/private messages, persistence, and a lot less code.

https://github.com/dparise/chat-app

Does seem a bit broken, some simple validation on names and rate limiting/checking for duplicates on messages will help from people spamming and trying to get script tags to run.

A set height and Overflow:scroll on the livechat div as well as the user list div seems pretty mandatory as well.

"Private" rooms seem to be getting the broadcasts from everyone or everyone is being placed into the same 'private' room, can't tell which.

I can open up as many 'user' views as I want with the same session id (on connection if session id exists load them into the chat else prompt them for the username).

edit: I see the validation now, checking if sessionStorage.username is undefined doesn't seem to be working though. Refreshing the page breaks as well, never triggers the loadhistory event that way.

It's cool, socket.io is pretty awesome, needs a little more work though

I think I find Together.js a little easier to use and integrate. At least, it passes the Grandma test - as in "Grandma, go to this site and press the Together button.."

https://togetherjs.com/