I love the fact the latest Google Chrome builds (version 4.0+) now support WebSockets. Recently I did a post on using Node.js (getting up and running) and if you haven’t read that post you might want to do that before continuing.
[ad name=”Google Adsense”]
Update July 8, 2010 – Using the latest code for both Node.js and node.websocket.js there is an error produced. The author of node.websocket.js has two new projects though that are actively maintained (as of this writing) that do similar things:
With Ubuntu 9.10 you need to install Chrome. You can get Google’s Chrome browser from here:
Please keep in mind as of the date of this article that Google Chrome for Linux is still beta quality software so make sure you know what your doing before installing this.
The installation of Chrome for me was quick and problem free. In a few minutes I had Chrome up and running. If you haven’t used Chrome before your in for a treat because it is a very fast and capable browser with very good support for web developers.
git clone git://github.com/guille/node.websocket.js.git
Once you have all the code you can run the server with the default:
This will default to running on localhost at port 8080. You can change the port if needed by doing the following:
node runserver.js --port='8888'
With the server up and running I simply dragged the “test.html” file out of the “node.websocket.js/test/websocket” folder and dropped it onto Chrome.
Next I took the “chat.html” file and dragged that into two instances of Chrome. From there I could run the chat program.
[ad name=”Google Adsense – large sqr rounded”]