Package com.gmt2001.httpwsserver
Class HttpSslRedirectHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<FullHttpRequest>
com.gmt2001.httpwsserver.HttpSslRedirectHandler
- All Implemented Interfaces:
ChannelHandler
,ChannelInboundHandler
Redirects HTTP requests to HTTPS, when SSL is enabled
- Author:
- gmt2001
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
channelRead0
(ChannelHandlerContext ctx, FullHttpRequest req) Redirects non-SSL requests to SSLvoid
exceptionCaught
(ChannelHandlerContext ctx, Throwable cause) Handles exceptions that are thrown up the stackMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
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
-
Method Details
-
channelRead0
Redirects non-SSL requests to SSL- Specified by:
channelRead0
in classSimpleChannelInboundHandler<FullHttpRequest>
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionreq
- TheFullHttpRequest
containing the request- Throws:
Exception
- Passes any thrown exceptions up the stack
-
exceptionCaught
Handles exceptions that are thrown up the stack- Specified by:
exceptionCaught
in interfaceChannelHandler
- Specified by:
exceptionCaught
in interfaceChannelInboundHandler
- Overrides:
exceptionCaught
in classChannelInboundHandlerAdapter
- Parameters:
ctx
- TheChannelHandlerContext
of the sessioncause
- The exception
-