@ChannelHandler.Sharable
public class HandshakeHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
The client will perform an initial HTTP POST request like the following
http://example.com/socket.io/1/
The absence of the transport id and session id segments will signal the server this is a new, non-handshaken connection.
The server can respond in three different ways:
401 Unauthorized
If the server refuses to authorize the client to connect, based on the supplied information (eg: Cookie header or custom query components).
No response body is required.
503 Service Unavailable
If the server refuses the connection for any reason (eg: overload).
No response body is required.
200 OK
The handshake was successful.
The body of the response should contain the session id (sid) given to the
client, followed by the heartbeat timeout, the connection closing timeout,
and the list of supported transports separated by :
The absence of a heartbeat timeout ('') is interpreted as the server and client not expecting heartbeats.
For example 4d4f185e96a7b:15:10:websocket,xhr-polling
| Constructor and Description |
|---|
HandshakeHandler(String handshakePath,
int heartbeatTimeout,
int closeTimeout,
String transports) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredhandlerAdded, handlerRemoved, isSharableCopyright © 2012–2016. All rights reserved.