Top Description Inners Fields Constructors Methods
io.netty5.handler.codec.http.websocketx

public final Class WebSocketClientProtocolConfig

extends Object
Class Inheritance
Imports
io.netty5.handler.codec.http.headers.HttpHeaders, java.net.URI, java.util.Objects

WebSocket server configuration.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final boolean
private final boolean
private final HttpHeaders
pack-priv static final boolean
pack-priv static final boolean
pack-priv static final boolean
pack-priv static final boolean
private final boolean
private final long
private final boolean
private final long
private final int
private final boolean
private final WebSocketCloseStatus
private final String
private final WebSocketVersion
private final URI

Constructor Summary

AccessConstructor and Description
private
WebSocketClientProtocolConfig(URI webSocketUri, String subprotocol, WebSocketVersion version, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public boolean
public HttpHeaders
public boolean
public long
public boolean
public long
public int
public static WebSocketClientProtocolConfig.Builder
public boolean
public WebSocketCloseStatus
public String
public WebSocketClientProtocolConfig.Builder
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public WebSocketVersion
public URI
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

absoluteUpgradeUrlback to summary
private final boolean absoluteUpgradeUrl
allowExtensionsback to summary
private final boolean allowExtensions
allowMaskMismatchback to summary
private final boolean allowMaskMismatch
customHeadersback to summary
private final HttpHeaders customHeaders
DEFAULT_ALLOW_MASK_MISMATCHback to summary
pack-priv static final boolean DEFAULT_ALLOW_MASK_MISMATCH
DEFAULT_DROP_PONG_FRAMESback to summary
pack-priv static final boolean DEFAULT_DROP_PONG_FRAMES
DEFAULT_HANDLE_CLOSE_FRAMESback to summary
pack-priv static final boolean DEFAULT_HANDLE_CLOSE_FRAMES
DEFAULT_PERFORM_MASKINGback to summary
pack-priv static final boolean DEFAULT_PERFORM_MASKING
dropPongFramesback to summary
private final boolean dropPongFrames
forceCloseTimeoutMillisback to summary
private final long forceCloseTimeoutMillis
handleCloseFramesback to summary
private final boolean handleCloseFrames
handshakeTimeoutMillisback to summary
private final long handshakeTimeoutMillis
maxFramePayloadLengthback to summary
private final int maxFramePayloadLength
performMaskingback to summary
private final boolean performMasking
sendCloseFrameback to summary
private final WebSocketCloseStatus sendCloseFrame
subprotocolback to summary
private final String subprotocol
versionback to summary
private final WebSocketVersion version
webSocketUriback to summary
private final URI webSocketUri

Constructor Detail

WebSocketClientProtocolConfigback to summary
private WebSocketClientProtocolConfig(URI webSocketUri, String subprotocol, WebSocketVersion version, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)

Method Detail

absoluteUpgradeUrlback to summary
public boolean absoluteUpgradeUrl()
allowExtensionsback to summary
public boolean allowExtensions()
allowMaskMismatchback to summary
public boolean allowMaskMismatch()
customHeadersback to summary
public HttpHeaders customHeaders()
dropPongFramesback to summary
public boolean dropPongFrames()
forceCloseTimeoutMillisback to summary
public long forceCloseTimeoutMillis()
handleCloseFramesback to summary
public boolean handleCloseFrames()
handshakeTimeoutMillisback to summary
public long handshakeTimeoutMillis()
maxFramePayloadLengthback to summary
public int maxFramePayloadLength()
newBuilderback to summary
public static WebSocketClientProtocolConfig.Builder newBuilder()
performMaskingback to summary
public boolean performMasking()
sendCloseFrameback to summary
public WebSocketCloseStatus sendCloseFrame()
subprotocolback to summary
public String subprotocol()
toBuilderback to summary
public WebSocketClientProtocolConfig.Builder toBuilder()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
versionback to summary
public WebSocketVersion version()
webSocketUriback to summary
public URI webSocketUri()
io.netty5.handler.codec.http.websocketx back to summary

public final Class WebSocketClientProtocolConfig.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty5.handler.codec.http.websocketx.WebSocketClientProtocolConfig.Builder

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private boolean
private HttpHeaders
private boolean
private long
private boolean
private long
private int
private boolean
private WebSocketCloseStatus
private String
private WebSocketVersion
private URI

Constructor Summary

AccessConstructor and Description
private
private
Builder(URI webSocketUri, String subprotocol, WebSocketVersion version, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)

Method Summary

Modifier and TypeMethod and Description
public WebSocketClientProtocolConfig.Builder
absoluteUpgradeUrl(boolean absoluteUpgradeUrl)

Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP

public WebSocketClientProtocolConfig.Builder
allowExtensions(boolean allowExtensions)

Allow extensions to be used in the reserved bits of the web socket frame

public WebSocketClientProtocolConfig.Builder
allowMaskMismatch(boolean allowMaskMismatch)

When set to true, frames which are not masked properly according to the standard will still be accepted.

public WebSocketClientProtocolConfig
build()

Build unmodifiable client protocol configuration.

public WebSocketClientProtocolConfig.Builder
customHeaders(HttpHeaders customHeaders)

Map of custom headers to add to the client request

public WebSocketClientProtocolConfig.Builder
dropPongFrames(boolean dropPongFrames)

true if pong frames should not be forwarded

public WebSocketClientProtocolConfig.Builder
forceCloseTimeoutMillis(long forceCloseTimeoutMillis)

Close the connection if it was not closed by the server after timeout specified

public WebSocketClientProtocolConfig.Builder
handleCloseFrames(boolean handleCloseFrames)

true if close frames should not be forwarded and just close the channel

public WebSocketClientProtocolConfig.Builder
handshakeTimeoutMillis(long handshakeTimeoutMillis)

Handshake timeout in millis, when handshake timeout, will trigger an inbound channel event WebSocketClientHandshakeCompletionEvent with a WebSocketHandshakeException.

public WebSocketClientProtocolConfig.Builder
maxFramePayloadLength(int maxFramePayloadLength)

Maximum length of a frame's payload

public WebSocketClientProtocolConfig.Builder
performMasking(boolean performMasking)

Whether to mask all written websocket frames.

public WebSocketClientProtocolConfig.Builder
sendCloseFrame(WebSocketCloseStatus sendCloseFrame)

Close frame to send, when close frame was not send manually.

public WebSocketClientProtocolConfig.Builder
subprotocol(String subprotocol)

Sub protocol request sent to the server.

public WebSocketClientProtocolConfig.Builder
version(WebSocketVersion version)

Version of web socket specification to use to connect to the server

public WebSocketClientProtocolConfig.Builder
webSocketUri(String webSocketUri)

URL for web socket communications.

public WebSocketClientProtocolConfig.Builder
webSocketUri(URI webSocketUri)

URL for web socket communications.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

absoluteUpgradeUrlback to summary
private boolean absoluteUpgradeUrl
allowExtensionsback to summary
private boolean allowExtensions
allowMaskMismatchback to summary
private boolean allowMaskMismatch
customHeadersback to summary
private HttpHeaders customHeaders
dropPongFramesback to summary
private boolean dropPongFrames
forceCloseTimeoutMillisback to summary
private long forceCloseTimeoutMillis
handleCloseFramesback to summary
private boolean handleCloseFrames
handshakeTimeoutMillisback to summary
private long handshakeTimeoutMillis
maxFramePayloadLengthback to summary
private int maxFramePayloadLength
performMaskingback to summary
private boolean performMasking
sendCloseFrameback to summary
private WebSocketCloseStatus sendCloseFrame
subprotocolback to summary
private String subprotocol
versionback to summary
private WebSocketVersion version
webSocketUriback to summary
private URI webSocketUri

Constructor Detail

Builderback to summary
private Builder(WebSocketClientProtocolConfig clientConfig)
Builderback to summary
private Builder(URI webSocketUri, String subprotocol, WebSocketVersion version, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl)

Method Detail

absoluteUpgradeUrlback to summary
public WebSocketClientProtocolConfig.Builder absoluteUpgradeUrl(boolean absoluteUpgradeUrl)

Use an absolute url for the Upgrade request, typically when connecting through an HTTP proxy over clear HTTP

allowExtensionsback to summary
public WebSocketClientProtocolConfig.Builder allowExtensions(boolean allowExtensions)

Allow extensions to be used in the reserved bits of the web socket frame

allowMaskMismatchback to summary
public WebSocketClientProtocolConfig.Builder allowMaskMismatch(boolean allowMaskMismatch)

When set to true, frames which are not masked properly according to the standard will still be accepted.

buildback to summary
public WebSocketClientProtocolConfig build()

Build unmodifiable client protocol configuration.

customHeadersback to summary
public WebSocketClientProtocolConfig.Builder customHeaders(HttpHeaders customHeaders)

Map of custom headers to add to the client request

dropPongFramesback to summary
public WebSocketClientProtocolConfig.Builder dropPongFrames(boolean dropPongFrames)

true if pong frames should not be forwarded

forceCloseTimeoutMillisback to summary
public WebSocketClientProtocolConfig.Builder forceCloseTimeoutMillis(long forceCloseTimeoutMillis)

Close the connection if it was not closed by the server after timeout specified

handleCloseFramesback to summary
public WebSocketClientProtocolConfig.Builder handleCloseFrames(boolean handleCloseFrames)

true if close frames should not be forwarded and just close the channel

handshakeTimeoutMillisback to summary
public WebSocketClientProtocolConfig.Builder handshakeTimeoutMillis(long handshakeTimeoutMillis)

Handshake timeout in millis, when handshake timeout, will trigger an inbound channel event WebSocketClientHandshakeCompletionEvent with a WebSocketHandshakeException.

maxFramePayloadLengthback to summary
public WebSocketClientProtocolConfig.Builder maxFramePayloadLength(int maxFramePayloadLength)

Maximum length of a frame's payload

performMaskingback to summary
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.

sendCloseFrameback to summary
public WebSocketClientProtocolConfig.Builder sendCloseFrame(WebSocketCloseStatus sendCloseFrame)

Close frame to send, when close frame was not send manually. Or null to disable proper close.

subprotocolback to summary
public WebSocketClientProtocolConfig.Builder subprotocol(String subprotocol)

Sub protocol request sent to the server.

versionback to summary
public WebSocketClientProtocolConfig.Builder version(WebSocketVersion version)

Version of web socket specification to use to connect to the server

webSocketUriback to summary
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.

webSocketUriback to summary
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.