Node.js is Exciting

By Jian Shuo Wang on 2010-12-26 23:05 · Hi-Tech Toys

Sign… Sometimes, when I got caught by some interesting and exciting technology, I was completely caught by them, and started to spend hours to figure out how to use them. The new toy for me this afternoon was node.js.

var socket = new io.Socket(‘http://ec2-175-41-189-167.ap-southeast-1.compute.amazonaws.com’, {port:8080});

socket.connect();

socket.on(‘connect’, function(client){

alert(‘connected’);

client.send(‘hello everyone’);

client.on(‘message’, function(msg) {

alert(’:’+msg);

});

});