Clone
 

scott blum <scottb@squareup.com> in Netty

HTTP2 server should not send preface string

Motivation:

See: https://github.com/netty/netty/issues/2402

See: https://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-3.5

Only the client should send the preface string, the server should not.

"The server connection header consists of just a SETTINGS frame (Section 6.5)

that MUST be the first frame the server sends in the HTTP/2 connection."

Modifications:

Split out Http2ClientPrefaceWriter and Http2ServerPrefaceReader from

Http2FrameEncoder and Http2FrameDecoder. The new channel handlers are added

to the pipeline and remove themselves after the preface is written/read.

Result:

HTTP2 client sends preface, server does not, in compliance with spec.

HTTP2 example uses SSL and NPN.

Motivation:

HTTP2 is generally negotiated over SSL, makes more sense to provide an SSL example.

Modifications:

Copy the SDPY example to add SSL and NPN negotiation to the HTTP2 example.

Result:

Http2Server and Http2Client examples use SSL.

HTTP2 example server should also log.

Motivation:

The HTTP2 example client logs, and it's useful to show what's

going on. It'd be sweet if the server did too.

Modifications:

Added Http2FrameLogger to example server pipeline.

Result:

HTTP2 example server will log frames.