Last Updated: February 25, 2016
· ihcsim

A Simple Chat Server Using nodejs express and

This example uses nodejs, express 3.1.0 and 0.9.13. to build a simple chat server: 1 file, 10 statements. This node stuff is pretty slick!

var express = require('express');
var app = express();
var server = require('http').createServer(app).listen(7000);
var io = require('').listen(server);
io.sockets.on('connection', function(client){
    client.on('message', function(err, msg){
        client.broadcast.emit('message', msg);

You can find the full source at