6 ms·
WebSocket whiteboard with chat
Just something I built to play around with the tech. Its using EventMachine for the server. Because its only using WebSockets and a more abstract layer like Socket.IO it will only work in Chrome / Safari. (or if you have WebSockets enabled in FireFox but I didn't test it)
The board will auto-clear every 5 minutes.
Have fun!
- bcardarella 16y agoJust something I built to play around with the tech. Its using EventMachine for the server. Because its only using WebSockets and not a more abstract layer like Socket.IO it will only work in Chrome / Safari. (or if you have WebSockets enabled in FireFox but I didn't test it) The board will auto-clear every 5 minutes. Have fun!
- mtinkerhess 16y agoPretty cool. It'd be nice if you could change your color -- I was yellow and that was hard to see.
- bcardarella 16y agoThe colors are assigned based upon a mod of your SID. So just refresh the page if you want a different color
- eik3_de 16y agoNice alternative: http://mrdoob.com/125/Multiuser_Sketchpad_HTML5 http://mrdoob.com/125/Multiuser_Sketchpad_HTML5
- yardie 16y agoCool. only one wiener on the whiteboard now. I can see this descend into chaos in a few hours.
- PHPAdam 16y agoIts not working for me Brian, which is a shame as I was going to draw some male genitalia.
- bcardarella 16y agoOnly works with WebSocket browsers. You'll need Chrome or Safari
- jackmanbob 16y agoNot working for me in Chrome 9.0.597.98
- nephics 16y agoBut it is not working with iPad's safari version
- demodifier 16y agoNice hack. In case you are using Node.js in the back end, you might want to check out socket.io. Provides Websocket support as well fall back transports for browsers that don't support WS.
- bcardarella 16y agoI'm using EventMachine with em-websocket for the backend. I might convert it to Node w/ Socket.IO to see if there is a performance difference.
- PHPAdam 16y agoI got chrome here somewhere, thanks for the TIP.
- samtp 16y agoDon't worry, I got you covered
- bcardarella 16y agoLooks like 40 concurrent users is the max. Process crashed but its back up now
- kvdr 16y agoCan you spawn a new whiteboard when more than 40 users join?
- bcardarella 16y agoThe error was due to a bad string message not parsing properly. I fixed it in the client and should be fine for new users now. But performance gets pretty crappy at about 40 concurrent users anyway. :p
- BuddhaSource 16y agoReally nice to interact live with strangers like this! I always thought HN guys were a bit more matured, it was funny to see every other 2nd doodle was of a dick!
- bcardarella 16y agoI just removed logging, which was causing the process to block so it could write to STDOUT. That should increase performance with tons of users.
- xutopia 16y agoI see you are a Rails dev. I imagine in the backend it's something more than a Rails app. What's your stack like?
- bcardarella 16y agoI'm using EventMachine with em-websocket. But I might rewrite it in NodeJS to give that try with Socket.IO
- nor-and-or-not 16y ago3 letters: XSS
- bcardarella 16y agoyeah, it was pretty hackish not to plug that. But it should be plugged now
- sciolistse 16y agoyou might want to escape those text messages.
- bcardarella 16y agoYeah I know, I was eating lunch when it went crazy
- yahelc 16y agoWow, so, I might have shut down the whole room by typing in the chat <script>window.close();</script> That room is a giant XSS disaster waiting to happen.
- kylemathews 16y agoYou did, it closes now almost immediately after opening.
- Charybdis 16y agoYes, you did. I wouldn't recommend going to the site on your own machine because of the security hole. They should fix this as soon as possible.
- bcardarella 16y agoYeah, I fixed that. It was just a weekend hack. I think the Goatse guy forced my hand
- yahelc 16y agoThanks for fixing it, and sorry about the window.close() thing :P Very cool; its mind-blowing how simple the code is. Can you post some of the server-side code?
- bcardarella 16y agoDon't worry about it. It was pretty funny. I'm going to probably release a NodeJS/Socket.IO version then do a blog post comparing the two and release all of the source code. Should have the Node one up in a day or two.
- Vivtek 16y agoFun!
- delano 16y agoI took a quick look. It's a cool demo but it's inappropriate to link to it here when there are obvious XSS issues.
- bcardarella 16y agoXSS fixed (I hope)
- s_m 16y agoThat's awesome – nice work.
- laskito 16y agoWhiteboard doesn't work very well with trackpads...
- tybris 16y agook, that's kind of cool. Thanks for fixing the XSS.
- stewsnooze 16y agoThis is cool. However the HN crowd seem to be just drawing deformed penis pics on it.
- robwgibbons 16y agoSo fun drawing trollfaces
- cookiecaper 16y agoFirefox 4 Beta 8+ users can enable websockets by toggling network.websocket.override-security-block in about:config. It still doesn't work in the latest nightly, though, as I can't draw anything. Websockets were disabled in Firefox 4b8+ because of supposed security problems in the protocol.
- sfphotoarts 16y agoDoesn't work for me Chrome 9.0.597.98 beta on Ubuntu :( Possibly because all HTTP traffic has to go through a proxy server, the company block all outbound traffic, and require a proxy server.
- bcardarella 16y agoThe websocket is also on port 8080 so that could be an issue