Reputation:
I have a web HTTP/1.1 server implementation that I've written in C++ using Berkeley sockets. I'm looking at implementing support for HTTP/2.0 (or SPDY) which allows for request and response multiplexing:
The binary framing layer in HTTP/2.0 enables full request and response multiplexing, by allowing the client and server to break down an HTTP message into independent frames, interleave them, and then reassemble them on the other end.
My question is as follows; how can I enable HTTP/2.0 (or SPDY) type request and response multiplexing with my already existing HTTP/1.1 program that is writting using the Berkeley Socket API? Perhaps the aformentioned frame multiplexing that is supported by HTTP/2.0 (or SPDY) is already handled by the existing mechanisms in the TCP/IP Stack, or?
Clarification:
I'm specifically interested in the part of multiplexing that use a single connection to deliver multiple requests and responses in parallel , I don't understand from the specs just how this is implemented in the application level protocol? Any ideas?
Upvotes: 3
Views: 1193
Reputation: 20842
No, the TCP stack doesnt handle any of this because SPDY isn't part of the TCP/IP stack, it is above TCP, traditionally what is considered an application protocol. Its control and data frames are documented in the draft spec. You implement multiplexing by implementing the protocol. TCP stack knows nothing about HTTP or SPDY.
In short, SPDY is made up of frames within a single TCP connection that include fairly simple headers with session id and frame length, among other things. You have to implement that to multiplex. You should be able to implement it all with standard SSL/TLS enabled socket code.
As far as I know, this is the spec -
http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2
Upvotes: 4