spdy-http2 / node-spdy

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

Use SPDY conditionally depending on SNI #161

Closed Rush closed 10 years ago

Rush commented 10 years ago

I know node provides only NPNProtocols without dynamic capabilities but perhaps it could be improved. What do you think?

indutny commented 10 years ago

You could use different NPNProtocols for each different SNI context in node, give it a try! ;)

Rush commented 10 years ago

Okay, so you're giving priority to this setting but what should I set it to?

NPNProtocols: An array or Buffer of possible NPN protocols. (Protocols should be ordered by their priority).

I want to either allow spdy for a particular host or not. I am using spdy.createServer.

indutny commented 10 years ago

Aaaah, I think I see what you mean.

indutny commented 10 years ago

So basically, you could pass the SNICallback option as in http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener, and make it return contexts with various NPNProtocols values as described in the same doc too.

Rush commented 10 years ago

I do not see the exact values I should set to make this work. So, would this work?

indutny commented 10 years ago

Aaah, sorry! Didn't get it. You could put here ['spdy/3.1', 'spdy/3', 'spdy/2', 'http/1.1'].