3 ms·
I have written a basic chat application using node.js, what do you guys think?
- bhaaai 15y agoI can't enter the chat. Save Name button does nothing! I'm on firefox 3.6.17.
- serkanyersen 15y agoI haven't made any crossbrowser test. It may only work on latest browsers. Sorry about that
- akkishore 15y agoIsn't this similar to http://chat.nodejs.org/ http://chat.nodejs.org/?
- serkanyersen 15y agoProbably. 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.
- serkanyersen 15y agoI 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 15y agoIt 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 15y agoWell 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
- LeafStorm 15y agoIt seems that when the client loses the connection, it doesn't attempt to reconnect.
- serkanyersen 15y agoYep, I just noticed that.
- limanoit 15y agoya..save name button does not do anything and it is almost similar to the chat demo of node.js
- chjj 15y agoI think writing a chat app is the rite of passage for node developers at this point.
- adrianpike 15y agoIt's node's hello world. :)
- serkanyersen 15y agoExactly :)
- tikhonj 15y agoYeah, 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.
- losethos 15y agodomestic 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
- spp 15y agoI've written a (very) basic mud server in node.js (in like 8 hours). Maybe you'll be interested: https://github.com/farevalod/nodemud https://github.com/farevalod/nodemud (I'd appreciate some comments on it too!)
- serkanyersen 15y agoIt would be great to see a working demo.
- serkanyersen 15y agoHaha. 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 https://github.com/serkanyersen/Basic-Chat
- serkanyersen 15y agook it's back now.
- bpfh 15y agoSeems 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 15y agoThanks. Those two security issues are fixed now. It was nice chatting with you :)
- JamesBlair 15y ago> > 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.
- akivabamberger 15y agough stop copying the node.js chat code and acting like it's something brand new. this is publicly available on rydahl's github.
- serkanyersen 15y agoI 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
- jiyinyiyong 15y agoUI 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.