Class WebSocketServerProtocolHandshakeHandler
- java.lang.Object
-
- org.jboss.netty.channel.SimpleChannelUpstreamHandler
-
- org.jboss.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandshakeHandler
-
- All Implemented Interfaces:
ChannelHandler
,ChannelUpstreamHandler
public class WebSocketServerProtocolHandshakeHandler extends SimpleChannelUpstreamHandler
Handles the HTTP handshake (the HTTP Upgrade request)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowExtensions
private static InternalLogger
logger
private java.lang.String
subprotocols
private java.lang.String
websocketPath
-
Constructor Summary
Constructors Constructor Description WebSocketServerProtocolHandshakeHandler(java.lang.String websocketPath, java.lang.String subprotocols, boolean allowExtensions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause)
private static java.lang.String
getWebSocketLocation(ChannelPipeline cp, HttpRequest req, java.lang.String path)
void
messageReceived(ChannelHandlerContext ctx, MessageEvent e)
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.private static void
sendHttpResponse(ChannelHandlerContext ctx, HttpRequest req, HttpResponse res)
-
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, writeComplete
-
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
-
websocketPath
private final java.lang.String websocketPath
-
subprotocols
private final java.lang.String subprotocols
-
allowExtensions
private final boolean allowExtensions
-
-
Method Detail
-
messageReceived
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws java.lang.Exception
Description copied from class:SimpleChannelUpstreamHandler
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.- Overrides:
messageReceived
in classSimpleChannelUpstreamHandler
- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendHttpResponse
private static void sendHttpResponse(ChannelHandlerContext ctx, HttpRequest req, HttpResponse res)
-
getWebSocketLocation
private static java.lang.String getWebSocketLocation(ChannelPipeline cp, HttpRequest req, java.lang.String path)
-
-