Instead of reading in static files yourself, you can just use connect (or s/connect/express/g and it'll also work):
var connect = require('connect');
var server = connect.createServer(connect.staticProvider(__dirname + '/static')).listen(4000);
Pow, that was easy! Plus, since connect (and express) are just up the prototype chain from http.Server, it works great with socket.io.