Class SniRouteHandler

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

    public class SniRouteHandler
    extends io.netty.handler.ssl.SniHandler
    Handler responsible for routing requests to proper backend based on SNI Host Name.
    Author:
    Sebastian Ɓaskawiec
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder

        io.netty.handler.codec.ByteToMessageDecoder.Cumulator
      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

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

      • Fields inherited from class io.netty.handler.ssl.SniHandler

        mapping
      • Fields inherited from class io.netty.handler.codec.ByteToMessageDecoder

        COMPOSITE_CUMULATOR, MERGE_CUMULATOR
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void decode​(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out)  
      boolean isHandShaked()
      Return true if handshake was successful.
      • Methods inherited from class io.netty.handler.ssl.SniHandler

        hostname, lookup, newSslHandler, onLookupComplete, replaceHandler, sslContext
      • Methods inherited from class io.netty.handler.ssl.AbstractSniHandler

        lookup, onLookupComplete
      • Methods inherited from class io.netty.handler.ssl.SslClientHelloHandler

        bind, close, connect, deregister, disconnect, flush, handlerRemoved0, read, write
      • Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder

        actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, isSharable
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Constructor Detail

      • SniRouteHandler

        public SniRouteHandler​(io.netty.util.DomainNameMapping<? extends io.netty.handler.ssl.SslContext> mapping,
                               RoutingTable routingTable)
        Creates new SniRouteHandler based on SNI Domain mapping and the RoutingTable.
        Parameters:
        mapping - SNI Host Name mapping.
        routingTable - The RoutingTable for supplying the Routes.
    • Method Detail

      • decode

        protected void decode​(io.netty.channel.ChannelHandlerContext ctx,
                              io.netty.buffer.ByteBuf in,
                              List<Object> out)
                       throws Exception
        Overrides:
        decode in class io.netty.handler.ssl.SslClientHelloHandler<io.netty.handler.ssl.SslContext>
        Throws:
        Exception
      • isHandShaked

        public boolean isHandShaked()
        Return true if handshake was successful.