-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suport HTTP Protocol Upgrade Mechanism #291
Comments
We've never implemented support for it, and in practice the plaintext upgrade functionality was essentially never deployed. In fact, it's being removed from the revision of the specification for HTTP/2 because of how little it was used. |
I am trying to do that manually, and streamChannel does not get initialized with my final handler. But handshake and settings exchange are successful. |
Can you show me what your pipeline setup looks like? |
I have something like this: self.deleteAllHandlers(context)
context.channel.configureHTTP2Pipeline(mode: .server) { streamChannel -> EventLoopFuture<Void> in
print("configureHTTP2Pipeline triggered")
return streamChannel.pipeline.addHandler(HTTP2FramePayloadToHTTP1ServerCodec(normalizeHTTPHeaders: true)).flatMap { () -> EventLoopFuture<Void> in
streamChannel.pipeline.addHandler(PlainHTTPHandler(fromHTTP2: true)).flatMap { () -> EventLoopFuture<Void> in
streamChannel.pipeline.addHandler(ErrorHandler())
}
}
}.flatMap { (_: HTTP2StreamMultiplexer) in
context.channel.pipeline.addHandler(ErrorHandler())
} |
And to be clear, this is attempting to do plaintext upgrade? |
Yes, this is a plaintext upgrade from HTTP/1. |
Ok, without changes to the core state machine this cannot work. HTTP/2 has a defined upgrade pattern from HTTP/1.1 that requires passing a SETTINGS frame in via a header, and consuming the body payload from the HTTP/1.1 request. You'd need to update the |
Is there a possibility to upgrade existing HTTP/1 connection to HTTP/2 on the server side?
Mozilla Doc about "Protocol Upgrade": https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade
The text was updated successfully, but these errors were encountered: