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 voidchannelRead0(ChannelHandlerContext ctx, FullHttpRequest req) Redirects non-SSL requests to SSLvoidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) Handles exceptions that are thrown up the stackMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Method Details
-
channelRead0
Redirects non-SSL requests to SSL- Specified by:
channelRead0in classSimpleChannelInboundHandler<FullHttpRequest>- Parameters:
ctx- TheChannelHandlerContextof the sessionreq- TheFullHttpRequestcontaining the request- Throws:
Exception- Passes any thrown exceptions up the stack
-
exceptionCaught
Handles exceptions that are thrown up the stack- Specified by:
exceptionCaughtin interfaceChannelHandler- Specified by:
exceptionCaughtin interfaceChannelInboundHandler- Overrides:
exceptionCaughtin classChannelInboundHandlerAdapter- Parameters:
ctx- TheChannelHandlerContextof the sessioncause- The exception
-