Created
November 10, 2011 14:46
-
-
Save kkestell/1355007 to your computer and use it in GitHub Desktop.
A Simple Chat Room with Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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