public class HttpClientOptions extends ClientOptionsBase
HttpClient
will make connections.Modifier and Type | Field and Description |
---|---|
static List<HttpVersion> |
DEFAULT_ALPN_VERSIONS
Default Application-Layer Protocol Negotiation versions = [] (automatic according to protocol version)
|
static int |
DEFAULT_DECODER_INITIAL_BUFFER_SIZE
Default initial buffer size for HttpObjectDecoder = 128 bytes
|
static String |
DEFAULT_DEFAULT_HOST
The default value for host name = "localhost"
|
static int |
DEFAULT_DEFAULT_PORT
The default value for port = 80
|
static boolean |
DEFAULT_FORCE_SNI |
static boolean |
DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE
Default using HTTP/1.1 upgrade for establishing an h2C connection =
true |
static boolean |
DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE_WITH_PREFLIGHT_REQUEST
Default to use a preflight OPTIONS request for h2C without prior knowledge connection =
false |
static int |
DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
The default connection window size for HTTP/2 = -1
|
static int |
DEFAULT_HTTP2_KEEP_ALIVE_TIMEOUT
The default keep alive timeout for HTTP/2 connection can send = 60 seconds
|
static int |
DEFAULT_HTTP2_MAX_POOL_SIZE
The default maximum number of connections an HTTP/2 client will pool = 1
|
static int |
DEFAULT_HTTP2_MULTIPLEXING_LIMIT
The default maximum number of concurrent streams per connection for HTTP/2 = -1
|
static boolean |
DEFAULT_KEEP_ALIVE
Default value of whether keep-alive is enabled =
true |
static int |
DEFAULT_KEEP_ALIVE_TIMEOUT
The default keep alive timeout for HTTP/1.1 connection can send = 60 seconds
|
static int |
DEFAULT_MAX_CHUNK_SIZE
Default max HTTP chunk size = 8192
|
static int |
DEFAULT_MAX_HEADER_SIZE
Default max length of all headers = 8192
|
static int |
DEFAULT_MAX_INITIAL_LINE_LENGTH
Default max length of the initial line (e.g.
|
static int |
DEFAULT_MAX_POOL_SIZE
The default maximum number of HTTP/1 connections a client will pool = 5
|
static int |
DEFAULT_MAX_REDIRECTS |
static int |
DEFAULT_MAX_WAIT_QUEUE_SIZE
Default max wait queue size = -1 (unbounded)
|
static int |
DEFAULT_MAX_WEBSOCKET_FRAME_SIZE
The default value for maximum WebSocket frame size = 65536 bytes
|
static int |
DEFAULT_MAX_WEBSOCKET_MESSAGE_SIZE
The default value for maximum WebSocket messages (could be assembled from multiple frames) is 4 full frames
worth of data
|
static int |
DEFAULT_MAX_WEBSOCKETS
The default value for the maximum number of WebSocket = 50
|
static String |
DEFAULT_NAME
Actual name of anonymous shared client =
__vertx.DEFAULT |
static boolean |
DEFAULT_PIPELINING
Default value of whether pipe-lining is enabled =
false |
static int |
DEFAULT_PIPELINING_LIMIT
The default maximum number of requests an HTTP/1.1 pipe-lined connection can send = 10
|
static int |
DEFAULT_POOL_CLEANER_PERIOD
Default pool cleaner period = 1000 ms (1 second)
|
static int |
DEFAULT_POOL_EVENT_LOOP_SIZE
Default pool event loop size = 0 (reuse current event-loop)
|
static HttpVersion |
DEFAULT_PROTOCOL_VERSION
The default protocol version = HTTP/1.1
|
static boolean |
DEFAULT_SEND_UNMASKED_FRAMES
Default WebSocket masked bit is true as depicted by RFC =
false |
static boolean |
DEFAULT_SHARED
Default shared client =
false |
static TracingPolicy |
DEFAULT_TRACING_POLICY
Default tracing control =
TracingPolicy.PROPAGATE |
static boolean |
DEFAULT_TRY_USE_COMPRESSION
Default value of whether the client will attempt to use compression =
false |
static boolean |
DEFAULT_TRY_USE_PER_FRAME_WEBSOCKET_COMPRESSION
Default offer WebSocket per-frame deflate compression extension =
false |
static boolean |
DEFAULT_TRY_USE_PER_MESSAGE_WEBSOCKET_COMPRESSION
Default offer WebSocket per-message deflate compression extension =
false |
static boolean |
DEFAULT_VERIFY_HOST
Default value of whether hostname verification (for SSL/TLS) is enabled =
true |
static boolean |
DEFAULT_WEBSOCKET_ALLOW_CLIENT_NO_CONTEXT
Default offering of the
server_no_context_takeover WebSocket parameter deflate compression extension = false |
static int |
DEFAULT_WEBSOCKET_CLOSING_TIMEOUT
Default WebSocket closing timeout = 10 second
|
static int |
DEFAULT_WEBSOCKET_COMPRESSION_LEVEL
Default WebSocket deflate compression level = 6
|
static boolean |
DEFAULT_WEBSOCKET_REQUEST_SERVER_NO_CONTEXT
Default offering of the
client_no_context_takeover WebSocket parameter deflate compression extension = false |
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_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_TIMEOUT
DEFAULT_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 |
---|
HttpClientOptions()
Default constructor
|
HttpClientOptions(HttpClientOptions other)
Copy constructor
|
HttpClientOptions(JsonObject json)
Constructor to create an options from JSON
|
Modifier and Type | Method and Description |
---|---|
HttpClientOptions |
addCrlPath(String crlPath)
Add a CRL path
|
HttpClientOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
HttpClientOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
HttpClientOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
HttpClientOptions |
addNonProxyHost(String nonProxyHost)
Add a
host to the ClientOptionsBase.getNonProxyHosts() list. |
List<HttpVersion> |
getAlpnVersions() |
int |
getDecoderInitialBufferSize() |
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 |
getHttp2ConnectionWindowSize() |
int |
getHttp2KeepAliveTimeout() |
int |
getHttp2MaxPoolSize()
Get the maximum pool size for HTTP/2 connections
|
int |
getHttp2MultiplexingLimit() |
Http2Settings |
getInitialSettings() |
int |
getKeepAliveTimeout() |
int |
getMaxChunkSize()
Returns the maximum HTTP chunk size
|
int |
getMaxHeaderSize() |
int |
getMaxInitialLineLength() |
int |
getMaxPoolSize()
Get the maximum pool size for connections
|
int |
getMaxRedirects() |
int |
getMaxWaitQueueSize()
Returns the maximum wait queue size
|
int |
getMaxWebSocketFrameSize()
Get the maximum WebSocket frame size to use
|
int |
getMaxWebSocketMessageSize()
Get the maximum WebSocket message size to use
|
int |
getMaxWebSockets()
Get the maximum of WebSockets per endpoint.
|
String |
getName() |
int |
getPipeliningLimit() |
int |
getPoolCleanerPeriod() |
int |
getPoolEventLoopSize() |
HttpVersion |
getProtocolVersion()
Get the protocol version.
|
TracingPolicy |
getTracingPolicy() |
boolean |
getTryUsePerMessageWebSocketCompression() |
boolean |
getTryWebSocketDeflateFrameCompression() |
int |
getWebSocketClosingTimeout() |
boolean |
getWebSocketCompressionAllowClientNoContext() |
int |
getWebSocketCompressionLevel() |
boolean |
getWebSocketCompressionRequestServerNoContext() |
boolean |
isForceSni() |
boolean |
isHttp2ClearTextUpgrade() |
boolean |
isHttp2ClearTextUpgradeWithPreflightRequest() |
boolean |
isKeepAlive()
Is keep alive enabled on the client?
|
boolean |
isPipelining()
Is pipe-lining enabled on the client
|
boolean |
isSendUnmaskedFrames() |
boolean |
isShared() |
boolean |
isTryUseCompression()
Is compression enabled on the client?
|
boolean |
isVerifyHost()
Is hostname verification (for SSL/TLS) enabled?
|
HttpClientOptions |
removeEnabledCipherSuite(String suite)
Removes an enabled cipher suite from the ordered suites.
|
HttpClientOptions |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
HttpClientOptions |
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.
|
HttpClientOptions |
setAlpnVersions(List<HttpVersion> alpnVersions)
Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation.
|
HttpClientOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
HttpClientOptions |
setDecoderInitialBufferSize(int decoderInitialBufferSize)
set to
initialBufferSizeHttpDecoder the initial buffer of the HttpDecoder. |
HttpClientOptions |
setDefaultHost(String defaultHost)
Set the default host name to be used by this client in requests if none is provided when making the request.
|
HttpClientOptions |
setDefaultPort(int defaultPort)
Set the default port to be used by this client in requests if none is provided when making the request.
|
HttpClientOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
HttpClientOptions |
setForceSni(boolean forceSni)
By default, the server name is only sent for Fully Qualified Domain Name (FQDN), setting
this property to
true forces the server name to be always sent. |
HttpClientOptions |
setHttp2ClearTextUpgrade(boolean value)
Set to
true when an h2c connection is established using an HTTP/1.1 upgrade request, and false
when an h2c connection is established directly (with prior knowledge). |
HttpClientOptions |
setHttp2ClearTextUpgradeWithPreflightRequest(boolean value)
Set to
true when an h2c connection established using an HTTP/1.1 upgrade request should perform
a preflight OPTIONS request to the origin server to establish the h2c connection. |
HttpClientOptions |
setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Set the default HTTP/2 connection window size.
|
HttpClientOptions |
setHttp2KeepAliveTimeout(int keepAliveTimeout)
Set the keep alive timeout for HTTP/2 connections, in seconds.
|
HttpClientOptions |
setHttp2MaxPoolSize(int max)
Set the maximum pool size for HTTP/2 connections
|
HttpClientOptions |
setHttp2MultiplexingLimit(int limit)
Set a client limit of the number concurrent streams for each HTTP/2 connection, this limits the number
of streams the client can create for a connection.
|
HttpClientOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
HttpClientOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
HttpClientOptions |
setInitialSettings(Http2Settings settings)
Set the HTTP/2 connection settings immediately sent by to the server when the client connects.
|
HttpClientOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
HttpClientOptions |
setKeepAlive(boolean keepAlive)
Set whether keep alive is enabled on the client
|
HttpClientOptions |
setKeepAliveTimeout(int keepAliveTimeout)
Set the keep alive timeout for HTTP/1.x, in seconds.
|
HttpClientOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
HttpClientOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
HttpClientOptions |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
HttpClientOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
HttpClientOptions |
setMaxChunkSize(int maxChunkSize)
Set the maximum HTTP chunk size
|
HttpClientOptions |
setMaxHeaderSize(int maxHeaderSize)
Set the maximum length of all headers for HTTP/1.x .
|
HttpClientOptions |
setMaxInitialLineLength(int maxInitialLineLength)
Set the maximum length of the initial line for HTTP/1.x (e.g.
|
HttpClientOptions |
setMaxPoolSize(int maxPoolSize)
Set the maximum pool size for connections
|
HttpClientOptions |
setMaxRedirects(int maxRedirects)
Set to
maxRedirects the maximum number of redirection a request can follow. |
HttpClientOptions |
setMaxWaitQueueSize(int maxWaitQueueSize)
Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in
a ConnectionPoolTooBusyException.
|
HttpClientOptions |
setMaxWebSocketFrameSize(int maxWebSocketFrameSize)
Set the max WebSocket frame size
|
HttpClientOptions |
setMaxWebSocketMessageSize(int maxWebSocketMessageSize)
Set the max WebSocket message size
|
HttpClientOptions |
setMaxWebSockets(int maxWebSockets)
Set the max number of WebSockets per endpoint.
|
HttpClientOptions |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
HttpClientOptions |
setName(String name)
Set the client name, used when the client is shared, otherwise ignored.
|
HttpClientOptions |
setNonProxyHosts(List<String> nonProxyHosts)
Set a list of remote hosts that are not proxied when the client is configured to use a proxy.
|
HttpClientOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
HttpClientOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
HttpClientOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
HttpClientOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
HttpClientOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
HttpClientOptions |
setPipelining(boolean pipelining)
Set whether pipe-lining is enabled on the client
|
HttpClientOptions |
setPipeliningLimit(int limit)
Set the limit of pending requests a pipe-lined HTTP/1 connection can send.
|
HttpClientOptions |
setPoolCleanerPeriod(int poolCleanerPeriod)
Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections
will remain in the pool until they are closed.
|
HttpClientOptions |
setPoolEventLoopSize(int poolEventLoopSize)
Set the number of event-loop the pool use.
|
HttpClientOptions |
setProtocolVersion(HttpVersion protocolVersion)
Set the protocol version.
|
HttpClientOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
HttpClientOptions |
setReadIdleTimeout(int idleTimeout)
Set the read idle timeout, default time unit is seconds.
|
HttpClientOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
HttpClientOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
HttpClientOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
HttpClientOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
HttpClientOptions |
setSendUnmaskedFrames(boolean sendUnmaskedFrames)
Set
true when the client wants to skip frame masking. |
HttpClientOptions |
setShared(boolean shared)
Set to
true to share the client. |
HttpClientOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
HttpClientOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
HttpClientOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
HttpClientOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
HttpClientOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
HttpClientOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
HttpClientOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
HttpClientOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
HttpClientOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
HttpClientOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
HttpClientOptions |
setTcpUserTimeout(int tcpUserTimeout)
Sets the
TCP_USER_TIMEOUT option - only with linux native transport. |
HttpClientOptions |
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.
|
HttpClientOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
HttpClientOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
HttpClientOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
HttpClientOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
HttpClientOptions |
setTryUseCompression(boolean tryUseCompression)
Set whether compression is enabled
|
HttpClientOptions |
setTryUsePerFrameWebSocketCompression(boolean offer)
Set whether the client will offer the WebSocket per-frame deflate compression extension.
|
HttpClientOptions |
setTryUsePerMessageWebSocketCompression(boolean offer)
Set whether the client will offer the WebSocket per-message deflate compression extension.
|
HttpClientOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
HttpClientOptions |
setVerifyHost(boolean verifyHost)
Set whether hostname verification is enabled
|
HttpClientOptions |
setWebSocketClosingTimeout(int webSocketClosingTimeout)
Set the amount of time a client WebSocket will wait until it closes the TCP connection after receiving a close frame.
|
HttpClientOptions |
setWebSocketCompressionAllowClientNoContext(boolean offer)
Set whether the
client_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered. |
HttpClientOptions |
setWebSocketCompressionLevel(int compressionLevel)
Set the WebSocket deflate compression level.
|
HttpClientOptions |
setWebSocketCompressionRequestServerNoContext(boolean offer)
Set whether the
server_no_context_takeover parameter of the WebSocket per-message
deflate compression extension will be offered. |
HttpClientOptions |
setWriteIdleTimeout(int idleTimeout)
Set the write idle timeout, default time unit is seconds.
|
JsonObject |
toJson()
Convert to JSON
|
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll
getCrlPaths, 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, isUseAlpn
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final int DEFAULT_MAX_POOL_SIZE
public static final int DEFAULT_HTTP2_MAX_POOL_SIZE
public static final int DEFAULT_HTTP2_MULTIPLEXING_LIMIT
public static final int DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
public static final int DEFAULT_HTTP2_KEEP_ALIVE_TIMEOUT
public static final boolean DEFAULT_KEEP_ALIVE
true
public static final boolean DEFAULT_PIPELINING
false
public static final int DEFAULT_PIPELINING_LIMIT
public static final int DEFAULT_KEEP_ALIVE_TIMEOUT
public static final boolean DEFAULT_TRY_USE_COMPRESSION
false
public static final boolean DEFAULT_VERIFY_HOST
true
public static final int DEFAULT_MAX_WEBSOCKET_FRAME_SIZE
public static final int DEFAULT_MAX_WEBSOCKET_MESSAGE_SIZE
public static final int DEFAULT_MAX_WEBSOCKETS
public static final String DEFAULT_DEFAULT_HOST
public static final int DEFAULT_DEFAULT_PORT
public static final HttpVersion DEFAULT_PROTOCOL_VERSION
public static final int DEFAULT_MAX_CHUNK_SIZE
public static final int DEFAULT_MAX_INITIAL_LINE_LENGTH
"HTTP/1.1 200 OK"
) = 4096public static final int DEFAULT_MAX_HEADER_SIZE
public static final int DEFAULT_MAX_WAIT_QUEUE_SIZE
public static final List<HttpVersion> DEFAULT_ALPN_VERSIONS
public static final boolean DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE
true
public static final boolean DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE_WITH_PREFLIGHT_REQUEST
false
public static final boolean DEFAULT_SEND_UNMASKED_FRAMES
false
public static final int DEFAULT_MAX_REDIRECTS
public static final boolean DEFAULT_FORCE_SNI
public static final int DEFAULT_DECODER_INITIAL_BUFFER_SIZE
public static final boolean DEFAULT_TRY_USE_PER_FRAME_WEBSOCKET_COMPRESSION
false
public static final boolean DEFAULT_TRY_USE_PER_MESSAGE_WEBSOCKET_COMPRESSION
false
public static final int DEFAULT_WEBSOCKET_COMPRESSION_LEVEL
public static final boolean DEFAULT_WEBSOCKET_ALLOW_CLIENT_NO_CONTEXT
server_no_context_takeover
WebSocket parameter deflate compression extension = false
public static final boolean DEFAULT_WEBSOCKET_REQUEST_SERVER_NO_CONTEXT
client_no_context_takeover
WebSocket parameter deflate compression extension = false
public static final int DEFAULT_POOL_CLEANER_PERIOD
public static final int DEFAULT_POOL_EVENT_LOOP_SIZE
public static final int DEFAULT_WEBSOCKET_CLOSING_TIMEOUT
public static final TracingPolicy DEFAULT_TRACING_POLICY
TracingPolicy.PROPAGATE
public static final boolean DEFAULT_SHARED
false
public static final String DEFAULT_NAME
__vertx.DEFAULT
public HttpClientOptions()
public HttpClientOptions(HttpClientOptions other)
other
- the options to copypublic HttpClientOptions(JsonObject json)
json
- the JSONpublic JsonObject toJson()
toJson
in class ClientOptionsBase
public HttpClientOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class ClientOptionsBase
sendBufferSize
- the buffers size, in bytespublic HttpClientOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class ClientOptionsBase
receiveBufferSize
- the buffers size, in bytespublic HttpClientOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class ClientOptionsBase
reuseAddress
- the value of reuse addresspublic HttpClientOptions setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class ClientOptionsBase
reusePort
- the value of reuse portpublic HttpClientOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class ClientOptionsBase
trafficClass
- the value of traffic classpublic HttpClientOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class ClientOptionsBase
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public HttpClientOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class ClientOptionsBase
tcpKeepAlive
- true if TCP keep alive is enabledpublic HttpClientOptions setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class ClientOptionsBase
soLinger
- true if SO_linger is enabledpublic HttpClientOptions setIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setIdleTimeout
in class ClientOptionsBase
idleTimeout
- the timeoutpublic HttpClientOptions setReadIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setReadIdleTimeout
in class ClientOptionsBase
idleTimeout
- the read timeoutpublic HttpClientOptions setWriteIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setWriteIdleTimeout
in class ClientOptionsBase
idleTimeout
- the write timeoutpublic HttpClientOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptions
setIdleTimeoutUnit
in class ClientOptionsBase
idleTimeoutUnit
- specify time unit.public HttpClientOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class ClientOptionsBase
ssl
- true if enabledpublic HttpClientOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class ClientOptionsBase
options
- the key store optionspublic HttpClientOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class ClientOptionsBase
options
- the key store in jks formatpublic HttpClientOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class ClientOptionsBase
options
- the key cert options in pfx formatpublic HttpClientOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class ClientOptionsBase
options
- the trust optionspublic HttpClientOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class ClientOptionsBase
options
- the options in pem formatpublic HttpClientOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class ClientOptionsBase
options
- the trust options in jks formatpublic HttpClientOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class ClientOptionsBase
options
- the trust options in pfx formatpublic HttpClientOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class ClientOptionsBase
options
- the trust options in pem formatpublic HttpClientOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class ClientOptionsBase
suite
- the suiteTCPSSLOptions.getEnabledCipherSuites()
public HttpClientOptions removeEnabledCipherSuite(String suite)
TCPSSLOptions
removeEnabledCipherSuite
in class ClientOptionsBase
suite
- the suitepublic HttpClientOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class ClientOptionsBase
protocol
- the SSL/TLS protocol to enablepublic HttpClientOptions removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
removeEnabledSecureTransportProtocol
in class ClientOptionsBase
protocol
- the SSL/TLS protocol to disablepublic HttpClientOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptions
TCP_FASTOPEN
option - only with linux native transport.setTcpFastOpen
in class ClientOptionsBase
tcpFastOpen
- the fast open valuepublic HttpClientOptions setTcpCork(boolean tcpCork)
TCPSSLOptions
TCP_CORK
option - only with linux native transport.setTcpCork
in class ClientOptionsBase
tcpCork
- the cork valuepublic HttpClientOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptions
TCP_QUICKACK
option - only with linux native transport.setTcpQuickAck
in class ClientOptionsBase
tcpQuickAck
- the quick ack valuepublic HttpClientOptions setTcpUserTimeout(int tcpUserTimeout)
TCPSSLOptions
TCP_USER_TIMEOUT
option - only with linux native transport.setTcpUserTimeout
in class ClientOptionsBase
tcpUserTimeout
- the tcp user timeout valuepublic HttpClientOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class ClientOptionsBase
crlPath
- the pathNullPointerException
public HttpClientOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class ClientOptionsBase
crlValue
- the valueNullPointerException
public HttpClientOptions setConnectTimeout(int connectTimeout)
ClientOptionsBase
setConnectTimeout
in class ClientOptionsBase
connectTimeout
- connect timeout, in mspublic HttpClientOptions setTrustAll(boolean trustAll)
ClientOptionsBase
setTrustAll
in class ClientOptionsBase
trustAll
- true if all should be trustedpublic HttpClientOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptions
setEnabledSecureTransportProtocols
in class TCPSSLOptions
enabledSecureTransportProtocols
- the SSL/TLS protocols to enablepublic HttpClientOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptions
setSslHandshakeTimeout
in class TCPSSLOptions
sslHandshakeTimeout
- the SSL handshake timeout to set, in millisecondspublic HttpClientOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptions
setSslHandshakeTimeoutUnit
in class TCPSSLOptions
sslHandshakeTimeoutUnit
- specify time unit.public int getMaxPoolSize()
public HttpClientOptions setMaxPoolSize(int maxPoolSize)
maxPoolSize
- the maximum pool sizepublic int getHttp2MultiplexingLimit()
-1
means
the value sent by the serverpublic HttpClientOptions setHttp2MultiplexingLimit(int limit)
-1
means to use the value sent by the server's initial settings.
-1
is the default value.limit
- the maximum concurrent for an HTTP/2 connectionpublic int getHttp2MaxPoolSize()
public HttpClientOptions setHttp2MaxPoolSize(int max)
max
- the maximum pool sizepublic int getHttp2ConnectionWindowSize()
public HttpClientOptions setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Http2Settings.getInitialWindowSize()
, so the connection window size
is greater than for its streams, in order the data throughput.
A value of -1
reuses the initial window size setting.http2ConnectionWindowSize
- the window size applied to the connectionpublic int getHttp2KeepAliveTimeout()
public HttpClientOptions setHttp2KeepAliveTimeout(int keepAliveTimeout)
0
means there is no timeout.keepAliveTimeout
- the timeout, in secondspublic boolean isKeepAlive()
true
if enabledpublic HttpClientOptions setKeepAlive(boolean keepAlive)
keepAlive
- true
if enabledpublic int getKeepAliveTimeout()
public HttpClientOptions setKeepAliveTimeout(int keepAliveTimeout)
0
means there is no timeout.keepAliveTimeout
- the timeout, in secondspublic boolean isPipelining()
true
if pipe-lining is enabledpublic HttpClientOptions setPipelining(boolean pipelining)
pipelining
- true
if enabledpublic int getPipeliningLimit()
public HttpClientOptions setPipeliningLimit(int limit)
limit
- the limit of pending requestspublic boolean isVerifyHost()
true
if enabledpublic HttpClientOptions setVerifyHost(boolean verifyHost)
verifyHost
- true
if enabledpublic boolean isTryUseCompression()
true
if enabledpublic HttpClientOptions setTryUseCompression(boolean tryUseCompression)
tryUseCompression
- true
if enabledpublic boolean isSendUnmaskedFrames()
true
when frame masking is skippedpublic HttpClientOptions 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 getMaxWebSocketFrameSize()
public HttpClientOptions setMaxWebSocketFrameSize(int maxWebSocketFrameSize)
maxWebSocketFrameSize
- the max frame size, in bytespublic int getMaxWebSocketMessageSize()
public HttpClientOptions setMaxWebSocketMessageSize(int maxWebSocketMessageSize)
maxWebSocketMessageSize
- the max message size, in bytespublic int getMaxWebSockets()
public HttpClientOptions setMaxWebSockets(int maxWebSockets)
maxWebSockets
- the max valuepublic String getDefaultHost()
public HttpClientOptions setDefaultHost(String defaultHost)
public int getDefaultPort()
public HttpClientOptions setDefaultPort(int defaultPort)
public HttpVersion getProtocolVersion()
public HttpClientOptions setProtocolVersion(HttpVersion protocolVersion)
protocolVersion
- the protocol versionpublic HttpClientOptions setMaxChunkSize(int maxChunkSize)
maxChunkSize
- the maximum chunk sizepublic int getMaxChunkSize()
public int getMaxInitialLineLength()
"GET / HTTP/1.0"
)public HttpClientOptions setMaxInitialLineLength(int maxInitialLineLength)
"HTTP/1.1 200 OK"
)maxInitialLineLength
- the new maximum initial lengthpublic int getMaxHeaderSize()
public HttpClientOptions setMaxHeaderSize(int maxHeaderSize)
maxHeaderSize
- the new maximum lengthpublic HttpClientOptions setMaxWaitQueueSize(int maxWaitQueueSize)
maxWaitQueueSize
- the maximum number of waiting requestspublic int getMaxWaitQueueSize()
public Http2Settings getInitialSettings()
public HttpClientOptions setInitialSettings(Http2Settings settings)
settings
- the settings valuepublic HttpClientOptions setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class ClientOptionsBase
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic HttpClientOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class ClientOptionsBase
sslEngineOptions
- the ssl engine to usepublic HttpClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class ClientOptionsBase
public HttpClientOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class ClientOptionsBase
public List<HttpVersion> getAlpnVersions()
setProtocolVersion(io.vertx.core.http.HttpVersion)
public HttpClientOptions setAlpnVersions(List<HttpVersion> alpnVersions)
setProtocolVersion(io.vertx.core.http.HttpVersion)
:
HttpVersion.HTTP_2
: [ "h2", "http/1.1" ]getProtocolVersion()
]alpnVersions
- the versionspublic boolean isHttp2ClearTextUpgrade()
true
when an h2c connection is established using an HTTP/1.1 upgrade request, false
when directlypublic HttpClientOptions setHttp2ClearTextUpgrade(boolean value)
true
when an h2c connection is established using an HTTP/1.1 upgrade request, and false
when an h2c connection is established directly (with prior knowledge).value
- the upgrade valuepublic boolean isHttp2ClearTextUpgradeWithPreflightRequest()
true
when an h2c connection established using an HTTP/1.1 upgrade request should perform
a preflight OPTIONS
request to the origin server to establish the h2c connectionpublic HttpClientOptions setHttp2ClearTextUpgradeWithPreflightRequest(boolean value)
true
when an h2c connection established using an HTTP/1.1 upgrade request should perform
a preflight OPTIONS
request to the origin server to establish the h2c connection.value
- the upgrade valuepublic int getMaxRedirects()
public HttpClientOptions setMaxRedirects(int maxRedirects)
maxRedirects
the maximum number of redirection a request can follow.maxRedirects
- the maximum number of redirectionpublic boolean isForceSni()
public HttpClientOptions setForceSni(boolean forceSni)
true
forces the server name to be always sent.forceSni
- true
when the client should always use SNI on TLS/SSL connectionspublic HttpClientOptions setMetricsName(String metricsName)
ClientOptionsBase
setMetricsName
in class ClientOptionsBase
metricsName
- the metrics namepublic HttpClientOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBase
setProxyOptions
in class ClientOptionsBase
proxyOptions
- proxy options objectpublic HttpClientOptions setNonProxyHosts(List<String> nonProxyHosts)
ClientOptionsBase
nonProxyHosts
configuration.
Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
setNonProxyHosts
in class ClientOptionsBase
nonProxyHosts
- the list of non proxies hostspublic HttpClientOptions addNonProxyHost(String nonProxyHost)
ClientOptionsBase
host
to the ClientOptionsBase.getNonProxyHosts()
list.addNonProxyHost
in class ClientOptionsBase
nonProxyHost
- the added hostpublic HttpClientOptions setLocalAddress(String localAddress)
ClientOptionsBase
setLocalAddress
in class ClientOptionsBase
localAddress
- the local addresspublic HttpClientOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class ClientOptionsBase
logEnabled
- true for logging the network activitypublic HttpClientOptions setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
NetworkOptions
setActivityLogDataFormat
in class ClientOptionsBase
activityLogDataFormat
- the format to usepublic HttpClientOptions setTryUsePerFrameWebSocketCompression(boolean offer)
offer
- true
to offer the per-frame deflate compression extensionpublic boolean getTryWebSocketDeflateFrameCompression()
true
when the WebSocket per-frame deflate compression extension will be offeredpublic HttpClientOptions setTryUsePerMessageWebSocketCompression(boolean offer)
offer
- true
to offer the per-message deflate compression extensionpublic boolean getTryUsePerMessageWebSocketCompression()
true
when the WebSocket per-message deflate compression extension will be offeredpublic HttpClientOptions setWebSocketCompressionLevel(int compressionLevel)
compressionLevel
- the WebSocket deflate compression levelpublic int getWebSocketCompressionLevel()
public HttpClientOptions setWebSocketCompressionAllowClientNoContext(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 getWebSocketCompressionAllowClientNoContext()
true
when the client_no_context_takeover
parameter for the WebSocket per-message
deflate compression extension will be offeredpublic HttpClientOptions setWebSocketCompressionRequestServerNoContext(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 getWebSocketCompressionRequestServerNoContext()
true
when the server_no_context_takeover
parameter for the WebSocket per-message
deflate compression extension will be offeredpublic int getWebSocketClosingTimeout()
public HttpClientOptions setWebSocketClosingTimeout(int webSocketClosingTimeout)
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.
webSocketClosingTimeout
- the timeout is secondspublic int getDecoderInitialBufferSize()
public HttpClientOptions setDecoderInitialBufferSize(int decoderInitialBufferSize)
initialBufferSizeHttpDecoder
the initial buffer of the HttpDecoder.decoderInitialBufferSize
- the initial buffer sizepublic int getPoolCleanerPeriod()
public HttpClientOptions setPoolCleanerPeriod(int poolCleanerPeriod)
poolCleanerPeriod
- the pool cleaner periodpublic int getPoolEventLoopSize()
0
which implies
to reuse the current event-looppublic HttpClientOptions setPoolEventLoopSize(int poolEventLoopSize)
0
, the client pool will use the current event-loop0
.poolEventLoopSize
- the new sizepublic TracingPolicy getTracingPolicy()
public HttpClientOptions setTracingPolicy(TracingPolicy tracingPolicy)
tracingPolicy
- the tracing policypublic boolean isShared()
public HttpClientOptions setShared(boolean shared)
true
to share the client.
There can be multiple shared clients distinguished by getName()
, when no specific
name is set, the DEFAULT_NAME
is used.
shared
- true
to use a shared clientpublic String getName()
public HttpClientOptions setName(String name)
name
- the new nameCopyright © 2024 Eclipse. All rights reserved.