public static final class WebSocketClientProtocolConfig.Builder
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
WebSocketClientProtocolConfig.Builder |
absoluteUpgradeUrl(boolean absoluteUpgradeUrl)
Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP
|
WebSocketClientProtocolConfig.Builder |
allowExtensions(boolean allowExtensions)
Allow extensions to be used in the reserved bits of the web socket frame
|
WebSocketClientProtocolConfig.Builder |
allowMaskMismatch(boolean allowMaskMismatch)
When set to true, frames which are not masked properly according to the standard will still be accepted.
|
WebSocketClientProtocolConfig |
build()
Build unmodifiable client protocol configuration.
|
WebSocketClientProtocolConfig.Builder |
customHeaders(HttpHeaders customHeaders)
Map of custom headers to add to the client request
|
WebSocketClientProtocolConfig.Builder |
dropPongFrames(boolean dropPongFrames)
true if pong frames should not be forwarded |
WebSocketClientProtocolConfig.Builder |
forceCloseTimeoutMillis(long forceCloseTimeoutMillis)
Close the connection if it was not closed by the server after timeout specified
|
WebSocketClientProtocolConfig.Builder |
generateOriginHeader(boolean generateOriginHeader)
Allows to generate the `Origin`|`Sec-WebSocket-Origin` header value for handshake request
according the given webSocketURI.
|
WebSocketClientProtocolConfig.Builder |
handleCloseFrames(boolean handleCloseFrames)
true if close frames should not be forwarded and just close the channel |
WebSocketClientProtocolConfig.Builder |
handshakeTimeoutMillis(long handshakeTimeoutMillis)
Handshake timeout in mills, when handshake timeout, will trigger user
event
WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT |
WebSocketClientProtocolConfig.Builder |
maxFramePayloadLength(int maxFramePayloadLength)
Maximum length of a frame's payload
|
WebSocketClientProtocolConfig.Builder |
performMasking(boolean performMasking)
Whether to mask all written websocket frames.
|
WebSocketClientProtocolConfig.Builder |
sendCloseFrame(WebSocketCloseStatus sendCloseFrame)
Close frame to send, when close frame was not send manually.
|
WebSocketClientProtocolConfig.Builder |
subprotocol(java.lang.String subprotocol)
Sub protocol request sent to the server.
|
WebSocketClientProtocolConfig.Builder |
version(WebSocketVersion version)
Version of web socket specification to use to connect to the server
|
WebSocketClientProtocolConfig.Builder |
webSocketUri(java.lang.String webSocketUri)
URL for web socket communications. e.g "ws://myhost.com/mypath".
|
WebSocketClientProtocolConfig.Builder |
webSocketUri(java.net.URI webSocketUri)
URL for web socket communications. e.g "ws://myhost.com/mypath".
|
WebSocketClientProtocolConfig.Builder |
withUTF8Validator(boolean withUTF8Validator)
Toggles UTF8 validation for payload of text websocket frames.
|
public WebSocketClientProtocolConfig.Builder webSocketUri(java.lang.String webSocketUri)
public WebSocketClientProtocolConfig.Builder webSocketUri(java.net.URI webSocketUri)
public WebSocketClientProtocolConfig.Builder subprotocol(java.lang.String subprotocol)
public WebSocketClientProtocolConfig.Builder version(WebSocketVersion version)
public WebSocketClientProtocolConfig.Builder allowExtensions(boolean allowExtensions)
public WebSocketClientProtocolConfig.Builder customHeaders(HttpHeaders customHeaders)
public WebSocketClientProtocolConfig.Builder maxFramePayloadLength(int maxFramePayloadLength)
public WebSocketClientProtocolConfig.Builder performMasking(boolean performMasking)
public WebSocketClientProtocolConfig.Builder allowMaskMismatch(boolean allowMaskMismatch)
public WebSocketClientProtocolConfig.Builder handleCloseFrames(boolean handleCloseFrames)
true
if close frames should not be forwarded and just close the channelpublic WebSocketClientProtocolConfig.Builder sendCloseFrame(WebSocketCloseStatus sendCloseFrame)
null
to disable proper close.public WebSocketClientProtocolConfig.Builder dropPongFrames(boolean dropPongFrames)
true
if pong frames should not be forwardedpublic WebSocketClientProtocolConfig.Builder handshakeTimeoutMillis(long handshakeTimeoutMillis)
WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
public WebSocketClientProtocolConfig.Builder forceCloseTimeoutMillis(long forceCloseTimeoutMillis)
public WebSocketClientProtocolConfig.Builder absoluteUpgradeUrl(boolean absoluteUpgradeUrl)
public WebSocketClientProtocolConfig.Builder generateOriginHeader(boolean generateOriginHeader)
true
as default.public WebSocketClientProtocolConfig.Builder withUTF8Validator(boolean withUTF8Validator)
public WebSocketClientProtocolConfig build()