spdy-http2 / node-spdy

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

Making a SPDY "framing layer only" impl #208

Closed daviddias closed 9 years ago

daviddias commented 9 years ago

Have you considered stripping out the framing layer of the SPDY implementation, so it can be used as a streams multiplexer for other transports, without requiring a http language on top nor SSL?

I'm currently after that, the end goal would be to make it compatible with https://github.com/docker/spdystream .

From what I managed to figure out of the code, creating a new stream should be something like:

var Connection = require('./../lib/spdy/connection')
var Stream = require('./../lib/spdy/stream')
// ...
var conn = new Connection(socket, {isServer: false})
var s = new Stream(conn, {})

But still trying to be able to figure out which event gets fired when a new SYN_STREAM is received and a new stream is created from one of the sides. Hints?

Thank you!

PS: Tagging @mafintosh as I believe he is also interest in this :) PPS: I'm daviddias on freenode/#io.js , if you prefer chat

indutny commented 9 years ago

This sounds very interesting! I'm in the middle of rewrite of the protocol implementation: https://github.com/indutny/node-spdy/tree/feature/http-2 . So it is probably a good idea to postpone it until this will be finished to avoid merge hell.

jbenet commented 9 years ago

@indutny what is a ballpark eta for the rewrite --i.e. {days, weeks, months}?

indutny commented 9 years ago

I would expect a couple of weeks.

indutny commented 9 years ago

Heya, just wanted to share this WIP with you: https://github.com/indutny/spdy-transport . Working on priority tree atm, going to re-implement PUSH streams right after that.

daviddias commented 9 years ago

@indutny that is fantastic! Huge ^5! Extra thanks for making it transport stream agnostic too, I would be looking to have that so that spdy-transport/spdystream can be one of the protocols on top of multistream-selectspecmodule

Also noticed that you made https://www.npmjs.com/package/stream-pair, going to use this for multistream tests, it makes a whole more sense than always opening sockets.

jbenet commented 9 years ago

@indutny thank you for the update, this looks great! particularly applaud the support for all the versions of the protocol-- A+++.

please let us know if we can help with things. we dont mean to get in the way or slow you down, but we're here to help should we be useful.

indutny commented 9 years ago

@jbenet thank you! There is one thing that I would appreciate being helped with :) Writing tests for SPDY parser. Something like https://github.com/indutny/spdy-transport/blob/master/test/http2/parser-test.js but for all SPDY versions (2 and 3).

daviddias commented 9 years ago

Happy to help on that @indutny :) (currently at MediterreneaJS, but should have something by the end of the week)

daviddias commented 9 years ago

Thank you :)