Class WebSocketServerProtocolHandshakeHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandshakeHandler
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Handles the HTTP handshake (the HTTP Upgrade request) for
WebSocketServerProtocolHandler.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelHandlerContextprivate ChannelPromiseprivate booleanprivate final WebSocketServerProtocolConfig -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate static booleanareOriginsAllowed(HttpRequest req, java.lang.CharSequence headerName, java.util.Set<java.lang.String> allowedOrigins) voidchannelRead(ChannelHandlerContext ctx, java.lang.Object msg) CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.private booleancheckNextUri(java.lang.String uri, java.lang.String websocketPath) voidDo nothing by default, sub-classes may override this method.private booleanprivate booleanprivate static voidMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
handlerRemoved
-
Field Details
-
serverConfig
-
ctx
-
handshakePromise
-
isWebSocketPath
private boolean isWebSocketPath
-
-
Constructor Details
-
WebSocketServerProtocolHandshakeHandler
WebSocketServerProtocolHandshakeHandler(WebSocketServerProtocolConfig serverConfig)
-
-
Method Details
-
handlerAdded
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerAddedin interfaceChannelHandler- Overrides:
handlerAddedin classChannelHandlerAdapter
-
channelRead
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelReadin interfaceChannelInboundHandler- Overrides:
channelReadin classChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
isOriginAllowed
-
areOriginsAllowed
private static boolean areOriginsAllowed(HttpRequest req, java.lang.CharSequence headerName, java.util.Set<java.lang.String> allowedOrigins) -
sendForbiddenResponse
-
isWebSocketPath
-
checkNextUri
private boolean checkNextUri(java.lang.String uri, java.lang.String websocketPath) -
applyHandshakeTimeout
private void applyHandshakeTimeout()
-