

I have written a basic chat application using node.js, what do you guys think? - serkanyersen
http://sekonode.herokuapp.com/

======
serkanyersen
Haha. Either heroku or Node.js couldn't handle the Hacker News traffic. If you
would like to see the code

<https://github.com/serkanyersen/Basic-Chat>

~~~
serkanyersen
ok it's back now.

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

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

~~~
serkanyersen
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

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

~~~
serkanyersen
Thanks. Those two security issues are fixed now. It was nice chatting with you
:)

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

------
spp
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!)

~~~
serkanyersen
It would be great to see a working demo.

~~~
spp
It's working at 4ws.cl:8800

------
chjj
I think writing a chat app is the rite of passage for node developers at this
point.

~~~
adrianpike
It's node's hello world. :)

~~~
serkanyersen
Exactly :)

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

------
akkishore
Isn't this similar to <http://chat.nodejs.org/>?

~~~
serkanyersen
Probably. I just wrote it to learn web sockets and node.js All websocket
examples was too complex to dig in so I made a simple one.

------
LeafStorm
It seems that when the client loses the connection, it doesn't attempt to
reconnect.

~~~
serkanyersen
Yep, I just noticed that.

------
akivabamberger
ugh stop copying the node.js chat code and acting like it's something brand
new. this is publicly available on rydahl's github.

~~~
serkanyersen
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

------
limanoit
ya..save name button does not do anything and it is almost similar to the chat
demo of node.js

------
bhaaai
I can't enter the chat. Save Name button does nothing! I'm on firefox 3.6.17.

~~~
serkanyersen
I haven't made any crossbrowser test. It may only work on latest browsers.
Sorry about that

