Class Http11To2UpgradeHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    @Sharable
    public class Http11To2UpgradeHandler
    extends io.netty.handler.ssl.ApplicationProtocolNegotiationHandler
    Handler responsible for TLS/ALPN negotiation as well as HTTP/1.1 Upgrade header handling
    Author:
    Sebastian Ɓaskawiec
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configureHttp1​(io.netty.channel.ChannelPipeline pipeline)  
      protected void configureHttp2​(io.netty.channel.ChannelPipeline pipeline)  
      void configurePipeline​(io.netty.channel.ChannelHandlerContext ctx, java.lang.String protocol)  
      void configurePipeline​(io.netty.channel.ChannelPipeline pipeline, java.lang.String protocol)  
      io.netty.handler.ssl.ApplicationProtocolConfig getAlpnConfiguration()  
      protected io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler getHttp11To2ConnectionHandler()
      Creates a handler for HTTP/1.1 -> HTTP/2 upgrade
      io.netty.channel.ChannelHandler getHttp1Handler()
      Gets HTTP/1.1 handler.
      io.netty.channel.ChannelHandler getHttp2Handler()
      Gets HTTP/2 handler.
      protected int maxContentLength()  
      • Methods inherited from class io.netty.handler.ssl.ApplicationProtocolNegotiationHandler

        exceptionCaught, handshakeFailure, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Constructor Detail

      • Http11To2UpgradeHandler

        public Http11To2UpgradeHandler​(RestServer restServer)
    • Method Detail

      • configurePipeline

        public void configurePipeline​(io.netty.channel.ChannelHandlerContext ctx,
                                      java.lang.String protocol)
                               throws java.lang.Exception
        Specified by:
        configurePipeline in class io.netty.handler.ssl.ApplicationProtocolNegotiationHandler
        Throws:
        java.lang.Exception
      • configurePipeline

        public void configurePipeline​(io.netty.channel.ChannelPipeline pipeline,
                                      java.lang.String protocol)
      • configureHttp2

        protected void configureHttp2​(io.netty.channel.ChannelPipeline pipeline)
      • configureHttp1

        protected void configureHttp1​(io.netty.channel.ChannelPipeline pipeline)
      • maxContentLength

        protected int maxContentLength()
      • getHttp11To2ConnectionHandler

        protected io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler getHttp11To2ConnectionHandler()
        Creates a handler for HTTP/1.1 -> HTTP/2 upgrade
        Returns:
        new instance of HttpToHttp2ConnectionHandler.
      • getHttp1Handler

        public io.netty.channel.ChannelHandler getHttp1Handler()
        Gets HTTP/1.1 handler.
        Returns:
        HTTP/1.1 handler.
      • getHttp2Handler

        public io.netty.channel.ChannelHandler getHttp2Handler()
        Gets HTTP/2 handler.
        Returns:
        HTTP/2 handler.
      • getAlpnConfiguration

        public io.netty.handler.ssl.ApplicationProtocolConfig getAlpnConfiguration()