27 comments

[ 3.2 ms ] story [ 77.6 ms ] thread
I can't enter the chat. Save Name button does nothing! I'm on firefox 3.6.17.
I haven't made any crossbrowser test. It may only work on latest browsers. Sorry about that
I see people are complaing about the XHR requests. That's not my fault. I'm using heroku for hosting and it does not support websockets, so I have to force socket.io to use ajax long polling. That's actually heroku's solution.

But if you run it on your server or Cloud9 ide it will work just fine.

It seems that most of the XHR requests are due to the "is writing" notifications, you may try throttling just those to reduce the number of requests.

Also, with so many users chatting the screen scrolls too fast so I would reduce the vertical spacing a bit.

Well I didn't think there would be so many people on it :) But it was so much fun until it failed :) I will probably fix those issues but it was just a demo to see node.js and socket.io
It seems that when the client loses the connection, it doesn't attempt to reconnect.
ya..save name button does not do anything and it is almost similar to the chat demo of node.js
I think writing a chat app is the rite of passage for node developers at this point.
Yeah, it's the first thing I did too. It's the most node and ajax/comet/websocket learning per line of code that actually outputs something useful.
domestic hers fitting houses dried sand greaves looker Egyptian weapon abstract discovers insight stroke dens passions paying genuinely oppressed contemptible inaccurate reneweth thoughts material break drew protracted additions DOMINE spouts
I've written a (very) basic mud server in node.js (in like 8 hours). Maybe you'll be interested: https://github.com/farevalod/nodemud (I'd appreciate some comments on it too!)
It would be great to see a working demo.
It's working at 4ws.cl:8800
pd: you should telnet/nc to 4ws.cl 8800 to connect.
Seems fairly usable atm. A few observations: there is an XSS vulnerability as you probably learned by now. Also, there was a moment when someone was submitting content and it appeared under my nick "bpfh".

Other than that, kudos for a simple well-functioning chat.

Thanks. Those two security issues are fixed now. It was nice chatting with you :)
> > Also, there was a moment when someone was submitting content and it appeared under my nick "bpfh".

> Thanks. Those two security issues are fixed now.

You fixed one way of nickname duplication, but so long as you allow arbitrary utf-8 strings, there are all sorts of non-printing characters to use. You should really get a list of everything to filter. I don't have any experience with node.js, so I don't know if anyone has written a library that does it.

ugh stop copying the node.js chat code and acting like it's something brand new. this is publicly available on rydahl's github.
I didn't say it's brand new. Actually this is basically a hello world aplication for node.js

I liked the output and wanted to know what people would think about it.

BTW, I didn't copy anything, I watched the video and saw ryan doing TCP chat example and I thought I can do it for web and that would be great to learn node.js and socket.io

UI is great. I wrote one serveral days ago, aiming to offer real time chat featute(http:zhonglichat.cnodejs.net), new I see how ugly that is.. Nodejs moke chating really fun.