Module io.netty5.codec.http
Class WebSocketClientProtocolConfig.Builder
- java.lang.Object
-
- io.netty5.handler.codec.http.websocketx.WebSocketClientProtocolConfig.Builder
-
- Enclosing class:
- WebSocketClientProtocolConfig
public static final class WebSocketClientProtocolConfig.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSocketClientProtocolConfig.Builder
absoluteUpgradeUrl(boolean absoluteUpgradeUrl)
Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTPWebSocketClientProtocolConfig.Builder
allowExtensions(boolean allowExtensions)
Allow extensions to be used in the reserved bits of the web socket frameWebSocketClientProtocolConfig.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 requestWebSocketClientProtocolConfig.Builder
dropPongFrames(boolean dropPongFrames)
true
if pong frames should not be forwardedWebSocketClientProtocolConfig.Builder
forceCloseTimeoutMillis(long forceCloseTimeoutMillis)
Close the connection if it was not closed by the server after timeout specifiedWebSocketClientProtocolConfig.Builder
handleCloseFrames(boolean handleCloseFrames)
true
if close frames should not be forwarded and just close the channelWebSocketClientProtocolConfig.Builder
handshakeTimeoutMillis(long handshakeTimeoutMillis)
Handshake timeout in millis, when handshake timeout, will trigger an inbound channel eventWebSocketClientHandshakeCompletionEvent
with aWebSocketHandshakeException
.WebSocketClientProtocolConfig.Builder
maxFramePayloadLength(int maxFramePayloadLength)
Maximum length of a frame's payloadWebSocketClientProtocolConfig.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(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 serverWebSocketClientProtocolConfig.Builder
webSocketUri(String webSocketUri)
URL for web socket communications. e.g "ws://myhost.com/mypath".WebSocketClientProtocolConfig.Builder
webSocketUri(URI webSocketUri)
URL for web socket communications. e.g "ws://myhost.com/mypath".
-
-
-
Method Detail
-
webSocketUri
public WebSocketClientProtocolConfig.Builder webSocketUri(String webSocketUri)
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
-
webSocketUri
public WebSocketClientProtocolConfig.Builder webSocketUri(URI webSocketUri)
URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be sent to this URL.
-
subprotocol
public WebSocketClientProtocolConfig.Builder subprotocol(String subprotocol)
Sub protocol request sent to the server.
-
version
public WebSocketClientProtocolConfig.Builder version(WebSocketVersion version)
Version of web socket specification to use to connect to the server
-
allowExtensions
public WebSocketClientProtocolConfig.Builder allowExtensions(boolean allowExtensions)
Allow extensions to be used in the reserved bits of the web socket frame
-
customHeaders
public WebSocketClientProtocolConfig.Builder customHeaders(HttpHeaders customHeaders)
Map of custom headers to add to the client request
-
maxFramePayloadLength
public WebSocketClientProtocolConfig.Builder maxFramePayloadLength(int maxFramePayloadLength)
Maximum length of a frame's payload
-
performMasking
public WebSocketClientProtocolConfig.Builder performMasking(boolean 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
public WebSocketClientProtocolConfig.Builder allowMaskMismatch(boolean allowMaskMismatch)
When set to true, frames which are not masked properly according to the standard will still be accepted.
-
handleCloseFrames
public WebSocketClientProtocolConfig.Builder handleCloseFrames(boolean handleCloseFrames)
true
if close frames should not be forwarded and just close the channel
-
sendCloseFrame
public WebSocketClientProtocolConfig.Builder sendCloseFrame(WebSocketCloseStatus sendCloseFrame)
Close frame to send, when close frame was not send manually. Ornull
to disable proper close.
-
dropPongFrames
public WebSocketClientProtocolConfig.Builder dropPongFrames(boolean dropPongFrames)
true
if pong frames should not be forwarded
-
handshakeTimeoutMillis
public WebSocketClientProtocolConfig.Builder handshakeTimeoutMillis(long handshakeTimeoutMillis)
Handshake timeout in millis, when handshake timeout, will trigger an inbound channel eventWebSocketClientHandshakeCompletionEvent
with aWebSocketHandshakeException
.
-
forceCloseTimeoutMillis
public WebSocketClientProtocolConfig.Builder forceCloseTimeoutMillis(long forceCloseTimeoutMillis)
Close the connection if it was not closed by the server after timeout specified
-
absoluteUpgradeUrl
public WebSocketClientProtocolConfig.Builder absoluteUpgradeUrl(boolean absoluteUpgradeUrl)
Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP
-
build
public WebSocketClientProtocolConfig build()
Build unmodifiable client protocol configuration.
-
-