Skip to content

Instantly share code, notes, and snippets.

@kkestell
Created November 10, 2011 14:46
Show Gist options
  • Save kkestell/1355007 to your computer and use it in GitHub Desktop.
Save kkestell/1355007 to your computer and use it in GitHub Desktop.
A Simple Chat Room with Node.js
var sys = require('sys');
var express = require('express');
var io = require('socket.io');
var app = express.createServer(express.staticProvider(__dirname + '/public'));
app.listen(8080);
var socket = io.listen(app);
socket.on('connection', function(client) {
client.on('message', function(message) {
socket.broadcast(message);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment