Package io.netty.handler.codec.http2
Class Http2ServerUpgradeCodec
- java.lang.Object
-
- io.netty.handler.codec.http2.Http2ServerUpgradeCodec
-
- All Implemented Interfaces:
io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec
public class Http2ServerUpgradeCodec extends Object implements io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec
Server-side codec for performing a cleartext upgrade from HTTP/1.x to HTTP/2.
-
-
Constructor Summary
Constructors Constructor Description Http2ServerUpgradeCodec(Http2ConnectionHandler connectionHandler)Creates the codec using a default name for the connection handler when adding to the pipeline.Http2ServerUpgradeCodec(Http2FrameCodec http2Codec, io.netty.channel.ChannelHandler... handlers)Creates the codec using a default name for the connection handler when adding to the pipeline.Http2ServerUpgradeCodec(Http2MultiplexCodec http2Codec)Creates the codec using a default name for the connection handler when adding to the pipeline.Http2ServerUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler)Creates the codec providing an upgrade to the given handler for HTTP/2.Http2ServerUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler, io.netty.channel.ChannelHandler... handlers)Http2ServerUpgradeCodec(String handlerName, Http2MultiplexCodec http2Codec)Creates the codec providing an upgrade to the given handler for HTTP/2.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanprepareUpgradeResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest upgradeRequest, io.netty.handler.codec.http.HttpHeaders headers)Collection<CharSequence>requiredUpgradeHeaders()voidupgradeTo(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest upgradeRequest)
-
-
-
Constructor Detail
-
Http2ServerUpgradeCodec
public Http2ServerUpgradeCodec(Http2ConnectionHandler connectionHandler)
Creates the codec using a default name for the connection handler when adding to the pipeline.- Parameters:
connectionHandler- the HTTP/2 connection handler
-
Http2ServerUpgradeCodec
public Http2ServerUpgradeCodec(Http2MultiplexCodec http2Codec)
Creates the codec using a default name for the connection handler when adding to the pipeline.- Parameters:
http2Codec- the HTTP/2 multiplexing handler.
-
Http2ServerUpgradeCodec
public Http2ServerUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler)
Creates the codec providing an upgrade to the given handler for HTTP/2.- Parameters:
handlerName- the name of the HTTP/2 connection handler to be used in the pipeline, ornullto auto-generate the nameconnectionHandler- the HTTP/2 connection handler
-
Http2ServerUpgradeCodec
public Http2ServerUpgradeCodec(String handlerName, Http2MultiplexCodec http2Codec)
Creates the codec providing an upgrade to the given handler for HTTP/2.- Parameters:
handlerName- the name of the HTTP/2 connection handler to be used in the pipeline.http2Codec- the HTTP/2 multiplexing handler.
-
Http2ServerUpgradeCodec
public Http2ServerUpgradeCodec(Http2FrameCodec http2Codec, io.netty.channel.ChannelHandler... handlers)
Creates the codec using a default name for the connection handler when adding to the pipeline.- Parameters:
http2Codec- the HTTP/2 frame handler.handlers- the handlers that will handle theHttp2Frames.
-
Http2ServerUpgradeCodec
public Http2ServerUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler, io.netty.channel.ChannelHandler... handlers)
-
-
Method Detail
-
requiredUpgradeHeaders
public Collection<CharSequence> requiredUpgradeHeaders()
- Specified by:
requiredUpgradeHeadersin interfaceio.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec
-
prepareUpgradeResponse
public boolean prepareUpgradeResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest upgradeRequest, io.netty.handler.codec.http.HttpHeaders headers)- Specified by:
prepareUpgradeResponsein interfaceio.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec
-
upgradeTo
public void upgradeTo(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest upgradeRequest)- Specified by:
upgradeToin interfaceio.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec
-
-