Skip to content

Instantly share code, notes, and snippets.

@ligfx
ligfx / gist:1366208
Created November 15, 2011 05:05 — forked from miyagawa/gist:1227494
monkeypatch socket.io to work with nginx with buffering on (e.g. dotcloud)
var monkeypatch = function(io) {
io.configure(function(){
io.set("transports", ["xhr-polling"]);
io.set("polling duration", 10);
});
io.handleRequest = _.wrap(io.handleRequest, function(next, req, res) {
res.writeHead = _.wrap(res.writeHead, function(next, status, headers) {
if (headers) { delete headers.Connection; }
return next.call(this, status, headers);
});