public class Http2ClientUpgradeCodec extends Object implements HttpClientUpgradeHandler.UpgradeCodec
Constructor and Description |
---|
Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
Creates the codec using a default name for the connection handler when adding to the
pipeline.
|
Http2ClientUpgradeCodec(String handlerName,
Http2ConnectionHandler connectionHandler)
Creates the codec providing an upgrade to the given handler for HTTP/2.
|
Modifier and Type | Method and Description |
---|---|
String |
protocol()
Returns the name of the protocol supported by this codec, as indicated by the
'UPGRADE' header. |
Collection<String> |
setUpgradeHeaders(ChannelHandlerContext ctx,
HttpRequest upgradeRequest)
Sets any protocol-specific headers required to the upgrade request.
|
void |
upgradeTo(ChannelHandlerContext ctx,
FullHttpResponse upgradeResponse)
Performs an HTTP protocol upgrade from the source codec.
|
public Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
connectionHandler
- the HTTP/2 connection handler.public Http2ClientUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler)
handlerName
- the name of the HTTP/2 connection handler to be used in the pipeline.connectionHandler
- the HTTP/2 connection handler.public String protocol()
HttpClientUpgradeHandler.UpgradeCodec
'UPGRADE'
header.protocol
in interface HttpClientUpgradeHandler.UpgradeCodec
public Collection<String> setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)
HttpClientUpgradeHandler.UpgradeCodec
setUpgradeHeaders
in interface HttpClientUpgradeHandler.UpgradeCodec
public void upgradeTo(ChannelHandlerContext ctx, FullHttpResponse upgradeResponse) throws Exception
HttpClientUpgradeHandler.UpgradeCodec
upgradeTo
in interface HttpClientUpgradeHandler.UpgradeCodec
ctx
- the context for the current handler.upgradeResponse
- the 101 Switching Protocols response that indicates that the server
has switched to this protocol.Exception
Copyright © 2008–2015 The Netty Project. All rights reserved.