spdy-http2 / node-spdy

SPDY server on Node.js
2.81k stars 196 forks source link

Add connect handler to allow proxy use cases #49

Closed igrigorik closed 12 years ago

igrigorik commented 12 years ago

Related to #48. Need to emit this to enable SPDY proxy / secure tunnel use cases.

indutny commented 12 years ago

Connection doesn't emit connect event AFAIK. And this event should occur on the stream level if I understand your aim correctly.

igrigorik commented 12 years ago

Hmm, well it does seem to work correctly here with this patch (vs not :)). I'll admit to being new to node though, so any tips or suggestions are definitely welcome!

indutny commented 12 years ago

Can you post code that works with that patch and doesn't without it as gist or inline here?

igrigorik commented 12 years ago
function handleConnect(res, socket) {
  console.log("never fires");
}

var server = spdy.createServer(options);

server.on("request", handleRequest);
server.on("connect", handleConnect);

server.listen(44300);

That's basically it.

indutny commented 12 years ago

Confirmed, merged. Thanks! :)