Class WebSocketClientProtocolConfig.Builder
java.lang.Object
io.netty.handler.codec.http.websocketx.WebSocketClientProtocolConfig.Builder
- Enclosing class:
WebSocketClientProtocolConfig
-
Method Summary
Modifier and TypeMethodDescriptionabsoluteUpgradeUrl(boolean absoluteUpgradeUrl) Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTPallowExtensions(boolean allowExtensions) Allow extensions to be used in the reserved bits of the web socket frameallowMaskMismatch(boolean allowMaskMismatch) When set to true, frames which are not masked properly according to the standard will still be accepted.build()Build unmodifiable client protocol configuration.customHeaders(HttpHeaders customHeaders) Map of custom headers to add to the client requestdropPongFrames(boolean dropPongFrames) trueif pong frames should not be forwardedforceCloseTimeoutMillis(long forceCloseTimeoutMillis) Close the connection if it was not closed by the server after timeout specifiedgenerateOriginHeader(boolean generateOriginHeader) Allows to generate the `Origin`|`Sec-WebSocket-Origin` header value for handshake request according the given webSocketURI.handleCloseFrames(boolean handleCloseFrames) trueif close frames should not be forwarded and just close the channelhandshakeTimeoutMillis(long handshakeTimeoutMillis) Handshake timeout in mills, when handshake timeout, will trigger user eventWebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUTmaxFramePayloadLength(int maxFramePayloadLength) Maximum length of a frame's payloadperformMasking(boolean performMasking) Whether to mask all written websocket frames.sendCloseFrame(WebSocketCloseStatus sendCloseFrame) Close frame to send, when close frame was not send manually.subprotocol(String subprotocol) Sub protocol request sent to the server.version(WebSocketVersion version) Version of web socket specification to use to connect to the serverwebSocketUri(String webSocketUri) URL for web socket communications. e.g "ws://myhost.com/mypath".webSocketUri(URI webSocketUri) URL for web socket communications. e.g "ws://myhost.com/mypath".withUTF8Validator(boolean withUTF8Validator) Toggles UTF8 validation for payload of text websocket frames.
-
Method Details
-
webSocketUri
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL. -
webSocketUri
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL. -
subprotocol
Sub protocol request sent to the server. -
version
Version of web socket specification to use to connect to the server -
allowExtensions
Allow extensions to be used in the reserved bits of the web socket frame -
customHeaders
Map of custom headers to add to the client request -
maxFramePayloadLength
Maximum length of a frame's payload -
performMasking
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. -
allowMaskMismatch
When set to true, frames which are not masked properly according to the standard will still be accepted. -
handleCloseFrames
trueif close frames should not be forwarded and just close the channel -
sendCloseFrame
Close frame to send, when close frame was not send manually. Ornullto disable proper close. -
dropPongFrames
trueif pong frames should not be forwarded -
handshakeTimeoutMillis
Handshake timeout in mills, when handshake timeout, will trigger user eventWebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT -
forceCloseTimeoutMillis
Close the connection if it was not closed by the server after timeout specified -
absoluteUpgradeUrl
Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP -
generateOriginHeader
Allows to generate the `Origin`|`Sec-WebSocket-Origin` header value for handshake request according the given webSocketURI. Usually it's not necessary and can be disabled, but for backward compatibility is set totrueas default. -
withUTF8Validator
Toggles UTF8 validation for payload of text websocket frames. By default validation is enabled. -
build
Build unmodifiable client protocol configuration.
-