Performs client side opening and closing handshakes for web socket specification version draft-ietf-hybi-thewebsocketprotocol- 10
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final boolean | |
| private String | |
| private static final InternalLogger | |
| public static final String | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | WebSocketClientHandshaker08(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. webSocketURL, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, boolean Allow extensions to be used in the reserved bits of the web socket frame allowExtensions, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength)Creates a new instance. |
| public | WebSocketClientHandshaker08(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. webSocketURL, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, boolean Allow extensions to be used in the reserved bits of the web socket frame allowExtensions, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength, boolean Whether to mask all written websocket frames. This must be set to true in order to be fully compatible
with the websocket specifications. Client applications that communicate with a non-standard server
which doesn't require masking might set this to false to achieve a higher performance. performMasking, boolean When set to true, frames which are not masked properly according to the standard will still be
accepted allowMaskMismatch)Creates a new instance. |
| public | WebSocketClientHandshaker08(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. webSocketURL, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, boolean Allow extensions to be used in the reserved bits of the web socket frame allowExtensions, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength, boolean Whether to mask all written websocket frames. This must be set to true in order to be fully compatible
with the websocket specifications. Client applications that communicate with a non-standard server
which doesn't require masking might set this to false to achieve a higher performance. performMasking, boolean When set to true, frames which are not masked properly according to the standard will still be
accepted allowMaskMismatch, long Close the connection if it was not closed by the server after timeout specified. forceCloseTimeoutMillis)Creates a new instance. |
| pack-priv | WebSocketClientHandshaker08(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. webSocketURL, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, boolean Allow extensions to be used in the reserved bits of the web socket frame allowExtensions, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength, boolean Whether to mask all written websocket frames. This must be set to true in order to be fully compatible
with the websocket specifications. Client applications that communicate with a non-standard server
which doesn't require masking might set this to false to achieve a higher performance. performMasking, boolean When set to true, frames which are not masked properly according to the standard will still be
accepted allowMaskMismatch, long Close the connection if it was not closed by the server after timeout specified. forceCloseTimeoutMillis, boolean Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over
clear HTTP absoluteUpgradeUrl)Creates a new instance. |
| pack-priv | WebSocketClientHandshaker08(URI
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
sent to this URL. webSocketURL, WebSocketVersion Version of web socket specification to use to connect to the server version, String Sub protocol request sent to the server. subprotocol, boolean Allow extensions to be used in the reserved bits of the web socket frame allowExtensions, HttpHeaders Map of custom headers to add to the client request customHeaders, int Maximum length of a frame's payload maxFramePayloadLength, boolean Whether to mask all written websocket frames. This must be set to true in order to be fully compatible
with the websocket specifications. Client applications that communicate with a non-standard server
which doesn't require masking might set this to false to achieve a higher performance. performMasking, boolean When set to true, frames which are not masked properly according to the standard will still be
accepted allowMaskMismatch, long Close the connection if it was not closed by the server after timeout specified. forceCloseTimeoutMillis, boolean Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over
clear HTTP absoluteUpgradeUrl, boolean Allows to generate a `Sec-WebSocket-Origin` header value for handshake request
according to the given webSocketURL generateOriginHeader)Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| protected FullHttpRequest | newHandshakeRequest()
Implements abstract io. Sends the opening request to the server: GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 8 |
| protected WebSocketFrameDecoder | newWebsocketDecoder()
Implements abstract io. |
| protected WebSocketFrameEncoder | newWebSocketEncoder()
Implements abstract io. |
| public WebSocketClientHandshaker08 | setForceCloseTimeoutMillis(long
Close the connection if it was not closed by the server after timeout specified forceCloseTimeoutMillis)Overrides io. |
| protected void | verify(FullHttpResponse
HTTP response returned from the server for the request sent by beginOpeningHandshake00(). response)Implements abstract io. Process server response: HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Protocol: chat |
| allowExtensions | back to summary |
|---|---|
| private final boolean allowExtensions | |
| allowMaskMismatch | back to summary |
|---|---|
| private final boolean allowMaskMismatch | |
| expectedChallengeResponseString | back to summary |
|---|---|
| private String expectedChallengeResponseString | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| MAGIC_GUID | back to summary |
|---|---|
| public static final String MAGIC_GUID | |
| performMasking | back to summary |
|---|---|
| private final boolean performMasking | |
| WebSocketClientHandshaker08 | back to summary |
|---|---|
| public WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength) Creates a new instance.
| |
| WebSocketClientHandshaker08 | back to summary |
|---|---|
| public WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch) Creates a new instance.
| |
| WebSocketClientHandshaker08 | back to summary |
|---|---|
| public WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis) Creates a new instance.
| |
| WebSocketClientHandshaker08 | back to summary |
|---|---|
| pack-priv WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl) Creates a new instance.
| |
| WebSocketClientHandshaker08 | back to summary |
|---|---|
| pack-priv WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, boolean generateOriginHeader) Creates a new instance.
| |
| newHandshakeRequest | back to summary |
|---|---|
| protected FullHttpRequest newHandshakeRequest() Implements abstract io. /** Sends the opening request to the server: GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 8
| |
| newWebsocketDecoder | back to summary |
|---|---|
| protected WebSocketFrameDecoder newWebsocketDecoder() Implements abstract io. Doc from io. Returns the decoder to use after handshake is complete.
| |
| newWebSocketEncoder | back to summary |
|---|---|
| protected WebSocketFrameEncoder newWebSocketEncoder() Implements abstract io. Doc from io. Returns the encoder to use after the handshake is complete.
| |
| setForceCloseTimeoutMillis | back to summary |
|---|---|
| public WebSocketClientHandshaker08 setForceCloseTimeoutMillis(long forceCloseTimeoutMillis) Overrides io. Doc from io. Sets timeout to close the connection if it was not closed by the server.
| |
| verify | back to summary |
|---|---|
| protected void verify(FullHttpResponse response) Implements abstract io. Process server response: HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Protocol: chat
| |