public class WebSocketClientOptions extends ClientOptionsBase
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALLDEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_USE_ALPN, DEFAULT_WRITE_IDLE_TIMEOUTDEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS| Constructor and Description |
|---|
WebSocketClientOptions()
Default constructor
|
WebSocketClientOptions(JsonObject json)
Constructor to create an options from JSON
|
WebSocketClientOptions(WebSocketClientOptions other)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
WebSocketClientOptions |
addCrlPath(String crlPath)
Add a CRL path
|
WebSocketClientOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
WebSocketClientOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
WebSocketClientOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
WebSocketClientOptions |
addNonProxyHost(String host)
Add a
host to the ClientOptionsBase.getNonProxyHosts() list. |
int |
getClosingTimeout() |
boolean |
getCompressionAllowClientNoContext() |
int |
getCompressionLevel() |
boolean |
getCompressionRequestServerNoContext() |
String |
getDefaultHost()
Get the default host name to be used by this client in requests if none is provided when making the request.
|
int |
getDefaultPort()
Get the default port to be used by this client in requests if none is provided when making the request.
|
int |
getMaxConnections()
Get the maximum of WebSockets per endpoint.
|
int |
getMaxFrameSize()
Get the maximum WebSocket frame size to use
|
int |
getMaxMessageSize()
Get the maximum WebSocket message size to use
|
String |
getName() |
boolean |
getTryUsePerFrameCompression() |
boolean |
getTryUsePerMessageCompression() |
boolean |
isSendUnmaskedFrames() |
boolean |
isShared() |
boolean |
isVerifyHost()
Is hostname verification (for SSL/TLS) enabled?
|
WebSocketClientOptions |
removeEnabledCipherSuite(String suite)
Removes an enabled cipher suite from the ordered suites.
|
WebSocketClientOptions |
setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.
|
WebSocketClientOptions |
setClosingTimeout(int closingTimeout)
Set the amount of time a client WebSocket will wait until it closes the TCP connection after receiving a close frame.
|
WebSocketClientOptions |
setCompressionAllowClientNoContext(boolean offer)
Set whether the
client_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered. |
WebSocketClientOptions |
setCompressionLevel(int compressionLevel)
Set the WebSocket deflate compression level.
|
WebSocketClientOptions |
setCompressionRequestServerNoContext(boolean offer)
Set whether the
server_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered. |
WebSocketClientOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
WebSocketClientOptions |
setDefaultHost(String defaultHost)
Set the default host name to be used by this client in requests if none is provided when making the request.
|
WebSocketClientOptions |
setDefaultPort(int defaultPort)
Set the default port to be used by this client in requests if none is provided when making the request.
|
WebSocketClientOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
WebSocketClientOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
WebSocketClientOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
WebSocketClientOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
WebSocketClientOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
WebSocketClientOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
WebSocketClientOptions |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
WebSocketClientOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
WebSocketClientOptions |
setMaxConnections(int maxConnections)
Set the max number of WebSockets per endpoint.
|
WebSocketClientOptions |
setMaxFrameSize(int maxFrameSize)
Set the max WebSocket frame size
|
WebSocketClientOptions |
setMaxMessageSize(int maxMessageSize)
Set the max WebSocket message size
|
WebSocketClientOptions |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
WebSocketClientOptions |
setName(String name)
Set the client name, used when the client is shared, otherwise ignored.
|
WebSocketClientOptions |
setNonProxyHosts(List<String> nonProxyHosts)
Set a list of remote hosts that are not proxied when the client is configured to use a proxy.
|
WebSocketClientOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
WebSocketClientOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
WebSocketClientOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
WebSocketClientOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
WebSocketClientOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
WebSocketClientOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
WebSocketClientOptions |
setReadIdleTimeout(int idleTimeout)
Set the read idle timeout, default time unit is seconds.
|
WebSocketClientOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
WebSocketClientOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
WebSocketClientOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
WebSocketClientOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
WebSocketClientOptions |
setSendUnmaskedFrames(boolean sendUnmaskedFrames)
Set
true when the client wants to skip frame masking. |
WebSocketClientOptions |
setShared(boolean shared)
Set to
true to share the client. |
WebSocketClientOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
WebSocketClientOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
WebSocketClientOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
WebSocketClientOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
WebSocketClientOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
WebSocketClientOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
WebSocketClientOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
WebSocketClientOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
WebSocketClientOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
WebSocketClientOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
WebSocketClientOptions |
setTcpUserTimeout(int tcpUserTimeout)
Sets the
TCP_USER_TIMEOUT option - only with linux native transport. |
WebSocketClientOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
WebSocketClientOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
WebSocketClientOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
WebSocketClientOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
WebSocketClientOptions |
setTryUsePerFrameCompression(boolean offer)
Set whether the client will offer the WebSocket per-frame deflate compression extension.
|
WebSocketClientOptions |
setTryUsePerMessageCompression(boolean offer)
Set whether the client will offer the WebSocket per-message deflate compression extension.
|
WebSocketClientOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
WebSocketClientOptions |
setVerifyHost(boolean verifyHost)
Set whether hostname verification is enabled
|
WebSocketClientOptions |
setWriteIdleTimeout(int idleTimeout)
Set the write idle timeout, default time unit is seconds.
|
JsonObject |
toJson()
Convert to JSON
|
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, removeEnabledSecureTransportProtocolgetCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpngetActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePortpublic WebSocketClientOptions()
public WebSocketClientOptions(WebSocketClientOptions other)
other - the options to copypublic WebSocketClientOptions(JsonObject json)
json - the JSONpublic String getDefaultHost()
public WebSocketClientOptions setDefaultHost(String defaultHost)
public int getDefaultPort()
public WebSocketClientOptions setDefaultPort(int defaultPort)
public boolean isVerifyHost()
true if enabledpublic WebSocketClientOptions setVerifyHost(boolean verifyHost)
verifyHost - true if enabledpublic boolean isSendUnmaskedFrames()
true when frame masking is skippedpublic WebSocketClientOptions setSendUnmaskedFrames(boolean sendUnmaskedFrames)
true when the client wants to skip frame masking.
You may want to set it true on server by server WebSocket communication: in this case you are by passing
RFC6455 protocol.
It's false as default.
sendUnmaskedFrames - true if enabledpublic int getMaxFrameSize()
public WebSocketClientOptions setMaxFrameSize(int maxFrameSize)
maxFrameSize - the max frame size, in bytespublic int getMaxMessageSize()
public WebSocketClientOptions setMaxMessageSize(int maxMessageSize)
maxMessageSize - the max message size, in bytespublic int getMaxConnections()
public WebSocketClientOptions setMaxConnections(int maxConnections)
maxConnections - the max valuepublic WebSocketClientOptions setTryUsePerFrameCompression(boolean offer)
offer - true to offer the per-frame deflate compression extensionpublic boolean getTryUsePerFrameCompression()
true when the WebSocket per-frame deflate compression extension will be offeredpublic WebSocketClientOptions setTryUsePerMessageCompression(boolean offer)
offer - true to offer the per-message deflate compression extensionpublic boolean getTryUsePerMessageCompression()
true when the WebSocket per-message deflate compression extension will be offeredpublic WebSocketClientOptions setCompressionLevel(int compressionLevel)
compressionLevel - the WebSocket deflate compression levelpublic int getCompressionLevel()
public WebSocketClientOptions setCompressionAllowClientNoContext(boolean offer)
client_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered.offer - true to offer the client_no_context_takeover parameterpublic boolean getCompressionAllowClientNoContext()
true when the client_no_context_takeover parameter for the WebSocket per-message
deflate compression extension will be offeredpublic WebSocketClientOptions setCompressionRequestServerNoContext(boolean offer)
server_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered.offer - true to offer the server_no_context_takeover parameterpublic boolean getCompressionRequestServerNoContext()
true when the server_no_context_takeover parameter for the WebSocket per-message
deflate compression extension will be offeredpublic int getClosingTimeout()
public WebSocketClientOptions setClosingTimeout(int closingTimeout)
When a WebSocket is closed, the server should close the TCP connection. This timeout will close the TCP connection on the client when it expires.
Set to 0L closes the TCP connection immediately after receiving the close frame.
Set to a negative value to disable it.
closingTimeout - the timeout is secondspublic boolean isShared()
public WebSocketClientOptions setShared(boolean shared)
true to share the client.
There can be multiple shared clients distinguished by getName(), when no specific
name is set, the HttpClientOptions.DEFAULT_NAME is used.
shared - true to use a shared clientpublic String getName()
public WebSocketClientOptions setName(String name)
name - the new namepublic JsonObject toJson()
toJson in class ClientOptionsBasepublic WebSocketClientOptions setTrustAll(boolean trustAll)
ClientOptionsBasesetTrustAll in class ClientOptionsBasetrustAll - true if all should be trustedpublic WebSocketClientOptions setConnectTimeout(int connectTimeout)
ClientOptionsBasesetConnectTimeout in class ClientOptionsBaseconnectTimeout - connect timeout, in mspublic WebSocketClientOptions setMetricsName(String metricsName)
ClientOptionsBasesetMetricsName in class ClientOptionsBasemetricsName - the metrics namepublic WebSocketClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBasesetProxyOptions in class ClientOptionsBaseproxyOptions - proxy options objectpublic WebSocketClientOptions setNonProxyHosts(List<String> nonProxyHosts)
ClientOptionsBasenonProxyHosts configuration.
Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
setNonProxyHosts in class ClientOptionsBasenonProxyHosts - the list of non proxies hostspublic WebSocketClientOptions setLocalAddress(String localAddress)
ClientOptionsBasesetLocalAddress in class ClientOptionsBaselocalAddress - the local addresspublic WebSocketClientOptions setLogActivity(boolean logEnabled)
NetworkOptionssetLogActivity in class ClientOptionsBaselogEnabled - true for logging the network activitypublic WebSocketClientOptions setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
NetworkOptionssetActivityLogDataFormat in class ClientOptionsBaseactivityLogDataFormat - the format to usepublic WebSocketClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptionssetTcpNoDelay in class ClientOptionsBasetcpNoDelay - true if TCP no delay is enabled (Nagle disabled)public WebSocketClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptionssetTcpKeepAlive in class ClientOptionsBasetcpKeepAlive - true if TCP keep alive is enabledpublic WebSocketClientOptions setSoLinger(int soLinger)
TCPSSLOptionssetSoLinger in class ClientOptionsBasesoLinger - true if SO_linger is enabledpublic WebSocketClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptionsTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)setIdleTimeout in class ClientOptionsBaseidleTimeout - the timeoutpublic WebSocketClientOptions setReadIdleTimeout(int idleTimeout)
TCPSSLOptionsTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)setReadIdleTimeout in class ClientOptionsBaseidleTimeout - the read timeoutpublic WebSocketClientOptions setWriteIdleTimeout(int idleTimeout)
TCPSSLOptionsTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)setWriteIdleTimeout in class ClientOptionsBaseidleTimeout - the write timeoutpublic WebSocketClientOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptionssetIdleTimeoutUnit in class ClientOptionsBaseidleTimeoutUnit - specify time unit.public WebSocketClientOptions setSsl(boolean ssl)
TCPSSLOptionssetSsl in class ClientOptionsBasessl - true if enabledpublic WebSocketClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptionssetKeyCertOptions in class ClientOptionsBaseoptions - the key store optionspublic WebSocketClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptionssetKeyStoreOptions in class ClientOptionsBaseoptions - the key store in jks formatpublic WebSocketClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptionssetPfxKeyCertOptions in class ClientOptionsBaseoptions - the key cert options in pfx formatpublic WebSocketClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptionssetPemKeyCertOptions in class ClientOptionsBaseoptions - the options in pem formatpublic WebSocketClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptionssetTrustOptions in class ClientOptionsBaseoptions - the trust optionspublic WebSocketClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptionssetTrustStoreOptions in class ClientOptionsBaseoptions - the trust options in jks formatpublic WebSocketClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptionssetPfxTrustOptions in class ClientOptionsBaseoptions - the trust options in pfx formatpublic WebSocketClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptionssetPemTrustOptions in class ClientOptionsBaseoptions - the trust options in pem formatpublic WebSocketClientOptions setUseAlpn(boolean useAlpn)
TCPSSLOptionssetUseAlpn in class ClientOptionsBaseuseAlpn - true when Application-Layer Protocol Negotiation should be usedpublic WebSocketClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptionssetSslEngineOptions in class ClientOptionsBasesslEngineOptions - the ssl engine to usepublic WebSocketClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions in class ClientOptionsBasepublic WebSocketClientOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions in class ClientOptionsBasepublic WebSocketClientOptions setSendBufferSize(int sendBufferSize)
NetworkOptionssetSendBufferSize in class ClientOptionsBasesendBufferSize - the buffers size, in bytespublic WebSocketClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptionssetReceiveBufferSize in class ClientOptionsBasereceiveBufferSize - the buffers size, in bytespublic WebSocketClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptionssetReuseAddress in class ClientOptionsBasereuseAddress - the value of reuse addresspublic WebSocketClientOptions setReusePort(boolean reusePort)
NetworkOptionssetReusePort in class ClientOptionsBasereusePort - the value of reuse portpublic WebSocketClientOptions setTrafficClass(int trafficClass)
NetworkOptionssetTrafficClass in class ClientOptionsBasetrafficClass - the value of traffic classpublic WebSocketClientOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptionsTCP_FASTOPEN option - only with linux native transport.setTcpFastOpen in class ClientOptionsBasetcpFastOpen - the fast open valuepublic WebSocketClientOptions setTcpCork(boolean tcpCork)
TCPSSLOptionsTCP_CORK option - only with linux native transport.setTcpCork in class ClientOptionsBasetcpCork - the cork valuepublic WebSocketClientOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptionsTCP_QUICKACK option - only with linux native transport.setTcpQuickAck in class ClientOptionsBasetcpQuickAck - the quick ack valuepublic WebSocketClientOptions setTcpUserTimeout(int tcpUserTimeout)
TCPSSLOptionsTCP_USER_TIMEOUT option - only with linux native transport.setTcpUserTimeout in class ClientOptionsBasetcpUserTimeout - the tcp user timeout valuepublic WebSocketClientOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptionssetEnabledSecureTransportProtocols in class TCPSSLOptionsenabledSecureTransportProtocols - the SSL/TLS protocols to enablepublic WebSocketClientOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptionssetSslHandshakeTimeout in class TCPSSLOptionssslHandshakeTimeout - the SSL handshake timeout to set, in millisecondspublic WebSocketClientOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptionssetSslHandshakeTimeoutUnit in class TCPSSLOptionssslHandshakeTimeoutUnit - specify time unit.public WebSocketClientOptions addNonProxyHost(String host)
ClientOptionsBasehost to the ClientOptionsBase.getNonProxyHosts() list.addNonProxyHost in class ClientOptionsBasehost - the added hostpublic WebSocketClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptionsaddEnabledCipherSuite in class ClientOptionsBasesuite - the suiteTCPSSLOptions.getEnabledCipherSuites()public WebSocketClientOptions removeEnabledCipherSuite(String suite)
TCPSSLOptionsremoveEnabledCipherSuite in class ClientOptionsBasesuite - the suitepublic WebSocketClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptionsaddCrlPath in class ClientOptionsBasecrlPath - the pathNullPointerExceptionpublic WebSocketClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptionsaddCrlValue in class ClientOptionsBasecrlValue - the valueNullPointerExceptionpublic WebSocketClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptionsaddEnabledSecureTransportProtocol in class ClientOptionsBaseprotocol - the SSL/TLS protocol to enableCopyright © 2023 Eclipse. All rights reserved.