public class HttpServerOptions extends NetServerOptions
HttpServer
instanceModifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ACCEPT_UNMASKED_FRAMES
Default WebSocket Masked bit is true as depicted by RFC =
false |
static List<HttpVersion> |
DEFAULT_ALPN_VERSIONS
Default Application-Layer Protocol Negotiation versions = [HTTP/2,HTTP/1.1]
|
static int |
DEFAULT_COMPRESSION_LEVEL
Default gzip/deflate compression level = 6 (Netty legacy)
|
static boolean |
DEFAULT_COMPRESSION_SUPPORTED
Default value of whether compression is supported =
false |
static int |
DEFAULT_DECODER_INITIAL_BUFFER_SIZE
Default initial buffer size for HttpObjectDecoder = 128 bytes
|
static boolean |
DEFAULT_DECOMPRESSION_SUPPORTED
Default value of whether decompression is supported =
false |
static boolean |
DEFAULT_HANDLE_100_CONTINE_AUTOMATICALLY
Default value of whether 100-Continue should be handled automatically =
false |
static boolean |
DEFAULT_HTTP2_CLEAR_TEXT_ENABLED
Default H2C is enabled =
true |
static int |
DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
The default HTTP/2 connection window size = -1
|
static int |
DEFAULT_HTTP2_RST_FLOOD_MAX_RST_FRAME_PER_WINDOW
HTTP/2 RST floods DDOS protection, max number of RST frame per time window allowed = 200.
|
static int |
DEFAULT_HTTP2_RST_FLOOD_WINDOW_DURATION
HTTP/2 RST floods DDOS protection, time window duration = 30.
|
static TimeUnit |
DEFAULT_HTTP2_RST_FLOOD_WINDOW_DURATION_TIME_UNIT
HTTP/2 RST floods DDOS protection, time window duration unit =
TimeUnit.SECONDS . |
static long |
DEFAULT_INITIAL_SETTINGS_MAX_CONCURRENT_STREAMS
The default initial settings max concurrent stream for an HTTP/2 server = 100
|
static int |
DEFAULT_MAX_CHUNK_SIZE
Default max HTTP chunk size = 8192
|
static int |
DEFAULT_MAX_FORM_ATTRIBUTE_SIZE
Default max size of a form attribute = 8192
|
static int |
DEFAULT_MAX_FORM_BUFFERED_SIZE
Default max number buffered bytes when decoding a form = 1024
|
static int |
DEFAULT_MAX_FORM_FIELDS
Default max number of form fields = 256
|
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_WEBSOCKET_FRAME_SIZE
Default max WebSocket frame size = 65536
|
static int |
DEFAULT_MAX_WEBSOCKET_MESSAGE_SIZE
Default max WebSocket message size (could be assembled from multiple frames) is 4 full frames
worth of data
|
static boolean |
DEFAULT_PER_FRAME_WEBSOCKET_COMPRESSION_SUPPORTED
Default support for WebSockets per-frame deflate compression extension =
true |
static boolean |
DEFAULT_PER_MESSAGE_WEBSOCKET_COMPRESSION_SUPPORTED
Default support for WebSockets per-message deflate compression extension =
true |
static int |
DEFAULT_PORT
Default port the server will listen on = 80
|
static boolean |
DEFAULT_REGISTER_WEBSOCKET_WRITE_HANDLERS
Whether write-handlers for server websockets should be registered by default = false.
|
static TracingPolicy |
DEFAULT_TRACING_POLICY
Default tracing control =
TracingPolicy.ALWAYS |
static boolean |
DEFAULT_WEBSOCKET_ALLOW_SERVER_NO_CONTEXT
Default allowance 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_PREFERRED_CLIENT_NO_CONTEXT
Default allowance of the
client_no_context_takeover WebSocket parameter deflate compression extension = false |
DEFAULT_ACCEPT_BACKLOG, DEFAULT_CLIENT_AUTH, DEFAULT_HOST, DEFAULT_PROXY_PROTOCOL_TIMEOUT, DEFAULT_PROXY_PROTOCOL_TIMEOUT_TIME_UNIT, DEFAULT_REGISTER_WRITE_HANDLER, DEFAULT_SNI, DEFAULT_USE_PROXY_PROTOCOL
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_KEEAPLIVE_INTERVAL_SECONDS, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_KEEPALIVE_COUNT, DEFAULT_TCP_KEEPALIVE_IDLE_SECONDS, 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 |
---|
HttpServerOptions()
Default constructor
|
HttpServerOptions(HttpServerOptions other)
Copy constructor
|
HttpServerOptions(JsonObject json)
Create an options from JSON
|
Modifier and Type | Method and Description |
---|---|
HttpServerOptions |
addCompressor(CompressionOptions compressor)
Add a compressor.
|
HttpServerOptions |
addCrlPath(String crlPath)
Add a CRL path
|
HttpServerOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
HttpServerOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
HttpServerOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
HttpServerOptions |
addWebSocketSubProtocol(String subProtocol)
Add a WebSocket sub-protocol to the list supported by the server.
|
List<HttpVersion> |
getAlpnVersions() |
int |
getCompressionLevel() |
List<CompressionOptions> |
getCompressors() |
int |
getDecoderInitialBufferSize() |
int |
getHttp2ConnectionWindowSize() |
int |
getHttp2RstFloodMaxRstFramePerWindow() |
int |
getHttp2RstFloodWindowDuration() |
TimeUnit |
getHttp2RstFloodWindowDurationTimeUnit() |
Http2Settings |
getInitialSettings() |
int |
getMaxChunkSize() |
int |
getMaxFormAttributeSize() |
int |
getMaxFormBufferedBytes() |
int |
getMaxFormFields() |
int |
getMaxHeaderSize() |
int |
getMaxInitialLineLength() |
int |
getMaxWebSocketFrameSize() |
int |
getMaxWebSocketMessageSize() |
boolean |
getPerFrameWebSocketCompressionSupported()
Get whether WebSocket the per-frame deflate compression extension is supported.
|
boolean |
getPerMessageWebSocketCompressionSupported()
Get whether WebSocket per-message deflate compression extension is supported.
|
TracingPolicy |
getTracingPolicy() |
boolean |
getWebSocketAllowServerNoContext() |
int |
getWebSocketClosingTimeout() |
int |
getWebSocketCompressionLevel() |
boolean |
getWebSocketPreferredClientNoContext() |
List<String> |
getWebSocketSubProtocols() |
boolean |
isAcceptUnmaskedFrames() |
boolean |
isCompressionSupported() |
boolean |
isDecompressionSupported() |
boolean |
isHandle100ContinueAutomatically() |
boolean |
isHttp2ClearTextEnabled() |
boolean |
isRegisterWebSocketWriteHandlers() |
boolean |
isRegisterWriteHandler() |
HttpServerOptions |
removeEnabledCipherSuite(String suite)
Removes an enabled cipher suite from the ordered suites.
|
HttpServerOptions |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
HttpServerOptions |
setAcceptBacklog(int acceptBacklog)
Set the accept back log
|
HttpServerOptions |
setAcceptUnmaskedFrames(boolean acceptUnmaskedFrames)
Set
true when the server accepts unmasked frame. |
HttpServerOptions |
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.
|
HttpServerOptions |
setAlpnVersions(List<HttpVersion> alpnVersions)
Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiatiation.
|
HttpServerOptions |
setClientAuth(ClientAuth clientAuth)
Set whether client auth is required
|
HttpServerOptions |
setCompressionLevel(int compressionLevel)
This method allows to set the compression level to be used in http1.x/2 response bodies
when compression support is turned on (@see setCompressionSupported) and the client advertises
to support
deflate/gzip compression in the Accept-Encoding header
default value is : 6 (Netty legacy)
The compression level determines how much the data is compressed on a scale from 1 to 9,
where '9' is trying to achieve the maximum compression ratio while '1' instead is giving
priority to speed instead of compression ratio using some algorithm optimizations and skipping
pedantic loops that usually gives just little improvements
While one can think that best value is always the maximum compression ratio,
there's a trade-off to consider: the most compressed level requires the most
computational work to compress/decompress data, e.g. |
HttpServerOptions |
setCompressionSupported(boolean compressionSupported)
Set whether the server should support gzip/deflate compression
(serving compressed responses to clients advertising support for them with Accept-Encoding header)
|
HttpServerOptions |
setCompressors(List<CompressionOptions> compressors)
Set the list of compressor to use instead of using the default gzip/deflate
setCompressionLevel(int) configuration. |
HttpServerOptions |
setDecoderInitialBufferSize(int decoderInitialBufferSize)
Set the initial buffer size for the HTTP decoder
|
HttpServerOptions |
setDecompressionSupported(boolean decompressionSupported)
Set whether the server supports decompression
|
HttpServerOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
HttpServerOptions |
setHandle100ContinueAutomatically(boolean handle100ContinueAutomatically)
Set whether 100 Continue should be handled automatically
|
HttpServerOptions |
setHost(String host)
Set the host
|
HttpServerOptions |
setHttp2ClearTextEnabled(boolean http2ClearTextEnabled)
Set whether HTTP/2 over clear text is enabled or disabled, default is enabled.
|
HttpServerOptions |
setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Set the default HTTP/2 connection window size.
|
HttpServerOptions |
setHttp2RstFloodMaxRstFramePerWindow(int http2RstFloodMaxRstFramePerWindow)
Set the max number of RST frame allowed per time window, this is used to prevent HTTP/2 RST frame flood DDOS
attacks.
|
HttpServerOptions |
setHttp2RstFloodWindowDuration(int http2RstFloodWindowDuration)
Set the duration of the time window when checking the max number of RST frames, this is used to prevent HTTP/2 RST frame flood DDOS
attacks.
|
HttpServerOptions |
setHttp2RstFloodWindowDurationTimeUnit(TimeUnit http2RstFloodWindowDurationTimeUnit)
Set the time unit of the duration of the time window when checking the max number of RST frames, this is used to
prevent HTTP/2 RST frame flood DDOS attacks.
|
HttpServerOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
HttpServerOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
HttpServerOptions |
setInitialSettings(Http2Settings settings)
Set the HTTP/2 connection settings immediatly sent by the server when a client connects.
|
HttpServerOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
Deprecated.
|
HttpServerOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
HttpServerOptions |
setKeyStoreOptions(JksOptions options)
Deprecated.
|
HttpServerOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
HttpServerOptions |
setMaxChunkSize(int maxChunkSize)
Set the maximum HTTP chunk size that
HttpServerRequest.handler(Handler) will receive |
HttpServerOptions |
setMaxFormAttributeSize(int maxSize)
Set the maximum size of a form attribute.
|
HttpServerOptions |
setMaxFormBufferedBytes(int maxFormBufferedBytes)
Set the maximum number of bytes a server can buffer when decoding a form.
|
HttpServerOptions |
setMaxFormFields(int maxFormFields)
Set the maximum number of fields of a form.
|
HttpServerOptions |
setMaxHeaderSize(int maxHeaderSize)
Set the maximum length of all headers for HTTP/1.x .
|
HttpServerOptions |
setMaxInitialLineLength(int maxInitialLineLength)
Set the maximum length of the initial line for HTTP/1.x (e.g.
|
HttpServerOptions |
setMaxWebSocketFrameSize(int maxWebSocketFrameSize)
Set the maximum WebSocket frames size
|
HttpServerOptions |
setMaxWebSocketMessageSize(int maxWebSocketMessageSize)
Set the maximum WebSocket message size
|
HttpServerOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
Deprecated.
|
HttpServerOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Deprecated.
|
HttpServerOptions |
setPemTrustOptions(PemTrustOptions options)
Deprecated.
|
HttpServerOptions |
setPerFrameWebSocketCompressionSupported(boolean supported)
Enable or disable support for the WebSocket per-frame deflate compression extension.
|
HttpServerOptions |
setPerMessageWebSocketCompressionSupported(boolean supported)
Enable or disable support for WebSocket per-message deflate compression extension.
|
HttpServerOptions |
setPfxKeyCertOptions(PfxOptions options)
Deprecated.
|
HttpServerOptions |
setPfxTrustOptions(PfxOptions options)
Deprecated.
|
HttpServerOptions |
setPort(int port)
Set the port
|
HttpServerOptions |
setProxyProtocolTimeout(long proxyProtocolTimeout)
Set the Proxy protocol timeout, default time unit is seconds.
|
HttpServerOptions |
setProxyProtocolTimeoutUnit(TimeUnit proxyProtocolTimeoutUnit)
Set the Proxy protocol timeout unit.
|
HttpServerOptions |
setReadIdleTimeout(int idleTimeout)
Set the read idle timeout, default time unit is seconds.
|
HttpServerOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
HttpServerOptions |
setRegisterWebSocketWriteHandlers(boolean registerWebSocketWriteHandlers)
Whether write-handlers for server websockets should be registered on the
EventBus . |
HttpServerOptions |
setRegisterWriteHandler(boolean registerWriteHandler)
Has no effect on HTTP server options.
|
HttpServerOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
HttpServerOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
HttpServerOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
HttpServerOptions |
setSni(boolean sni)
Set whether the server supports Server Name Indiciation
|
HttpServerOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
HttpServerOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
HttpServerOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
HttpServerOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
HttpServerOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
HttpServerOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
HttpServerOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
HttpServerOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
HttpServerOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
HttpServerOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
HttpServerOptions |
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the server behavior when Vert.x has tracing enabled.
|
HttpServerOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
HttpServerOptions |
setTrafficShapingOptions(TrafficShapingOptions trafficShapingOptions)
Set traffic shaping options.
|
HttpServerOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
HttpServerOptions |
setTrustStoreOptions(JksOptions options)
Deprecated.
|
HttpServerOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
HttpServerOptions |
setUseProxyProtocol(boolean useProxyProtocol)
Set whether the server uses the HA Proxy protocol
|
HttpServerOptions |
setWebSocketAllowServerNoContext(boolean accept)
Set whether the WebSocket server will accept the
server_no_context_takeover parameter of the per-message
deflate compression extension offered by the client. |
HttpServerOptions |
setWebSocketClosingTimeout(int webSocketClosingTimeout)
Set the amount of time a server WebSocket will wait until it closes the TCP connection
after sending a close frame.
|
HttpServerOptions |
setWebSocketCompressionLevel(int compressionLevel)
Set the WebSocket compression level.
|
HttpServerOptions |
setWebSocketPreferredClientNoContext(boolean accept)
Set whether the WebSocket server will accept the
client_no_context_takeover parameter of the per-message
deflate compression extension offered by the client. |
HttpServerOptions |
setWebSocketSubProtocols(List<String> subProtocols)
Set the WebSocket list of sub-protocol supported by the server.
|
HttpServerOptions |
setWriteIdleTimeout(int idleTimeout)
Set the write idle timeout, default time unit is seconds.
|
JsonObject |
toJson()
Convert to JSON
|
getAcceptBacklog, getClientAuth, getHost, getPort, getProxyProtocolTimeout, getProxyProtocolTimeoutUnit, getTrafficShapingOptions, isSni, isUseProxyProtocol
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpKeepAliveCount, getTcpKeepAliveIdleSeconds, getTcpKeepAliveIntervalSeconds, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setTcpKeepAliveCount, setTcpKeepAliveIdleSeconds, setTcpKeepAliveIntervalSeconds, setTcpUserTimeout
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final int DEFAULT_PORT
public static final boolean DEFAULT_COMPRESSION_SUPPORTED
false
public static final int DEFAULT_COMPRESSION_LEVEL
public static final int DEFAULT_MAX_WEBSOCKET_FRAME_SIZE
public static final int DEFAULT_MAX_WEBSOCKET_MESSAGE_SIZE
public static final int DEFAULT_MAX_CHUNK_SIZE
public static final int DEFAULT_MAX_INITIAL_LINE_LENGTH
"GET / HTTP/1.0"
) = 4096public static final int DEFAULT_MAX_HEADER_SIZE
public static final int DEFAULT_MAX_FORM_ATTRIBUTE_SIZE
public static final int DEFAULT_MAX_FORM_FIELDS
public static final int DEFAULT_MAX_FORM_BUFFERED_SIZE
public static final boolean DEFAULT_HANDLE_100_CONTINE_AUTOMATICALLY
false
public static final List<HttpVersion> DEFAULT_ALPN_VERSIONS
public static final boolean DEFAULT_HTTP2_CLEAR_TEXT_ENABLED
true
public static final long DEFAULT_INITIAL_SETTINGS_MAX_CONCURRENT_STREAMS
public static final int DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
public static final boolean DEFAULT_DECOMPRESSION_SUPPORTED
false
public static final boolean DEFAULT_ACCEPT_UNMASKED_FRAMES
false
public static final int DEFAULT_DECODER_INITIAL_BUFFER_SIZE
public static final boolean DEFAULT_PER_FRAME_WEBSOCKET_COMPRESSION_SUPPORTED
true
public static final boolean DEFAULT_PER_MESSAGE_WEBSOCKET_COMPRESSION_SUPPORTED
true
public static final int DEFAULT_WEBSOCKET_COMPRESSION_LEVEL
public static final boolean DEFAULT_WEBSOCKET_ALLOW_SERVER_NO_CONTEXT
server_no_context_takeover
WebSocket parameter deflate compression extension = false
public static final boolean DEFAULT_WEBSOCKET_PREFERRED_CLIENT_NO_CONTEXT
client_no_context_takeover
WebSocket parameter deflate compression extension = false
public static final int DEFAULT_WEBSOCKET_CLOSING_TIMEOUT
public static final TracingPolicy DEFAULT_TRACING_POLICY
TracingPolicy.ALWAYS
public static final boolean DEFAULT_REGISTER_WEBSOCKET_WRITE_HANDLERS
public static final int DEFAULT_HTTP2_RST_FLOOD_MAX_RST_FRAME_PER_WINDOW
public static final int DEFAULT_HTTP2_RST_FLOOD_WINDOW_DURATION
public static final TimeUnit DEFAULT_HTTP2_RST_FLOOD_WINDOW_DURATION_TIME_UNIT
TimeUnit.SECONDS
.public HttpServerOptions()
public HttpServerOptions(HttpServerOptions other)
other
- the options to copypublic HttpServerOptions(JsonObject json)
json
- the JSONpublic JsonObject toJson()
toJson
in class NetServerOptions
public HttpServerOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class NetServerOptions
sendBufferSize
- the buffers size, in bytespublic HttpServerOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class NetServerOptions
receiveBufferSize
- the buffers size, in bytespublic HttpServerOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class NetServerOptions
reuseAddress
- the value of reuse addresspublic HttpServerOptions setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class NetServerOptions
reusePort
- the value of reuse portpublic HttpServerOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class NetServerOptions
trafficClass
- the value of traffic classpublic HttpServerOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class NetServerOptions
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public HttpServerOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class NetServerOptions
tcpKeepAlive
- true if TCP keep alive is enabledpublic HttpServerOptions setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class NetServerOptions
soLinger
- true if SO_linger is enabledpublic HttpServerOptions setIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setIdleTimeout
in class NetServerOptions
idleTimeout
- the timeoutpublic HttpServerOptions setReadIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setReadIdleTimeout
in class NetServerOptions
idleTimeout
- the read timeoutpublic HttpServerOptions setWriteIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setWriteIdleTimeout
in class NetServerOptions
idleTimeout
- the write timeoutpublic HttpServerOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptions
setIdleTimeoutUnit
in class NetServerOptions
idleTimeoutUnit
- specify time unit.public HttpServerOptions setSsl(boolean ssl)
TCPSSLOptions
setSsl
in class NetServerOptions
ssl
- true if enabledpublic HttpServerOptions setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class NetServerOptions
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic HttpServerOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class NetServerOptions
options
- the key store options@Deprecated public HttpServerOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class NetServerOptions
options
- the key store in jks format@Deprecated public HttpServerOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class NetServerOptions
options
- the key cert options in pfx format@Deprecated public HttpServerOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class NetServerOptions
options
- the options in pem formatpublic HttpServerOptions setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class NetServerOptions
options
- the trust options@Deprecated public HttpServerOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class NetServerOptions
options
- the trust options in jks format@Deprecated public HttpServerOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class NetServerOptions
options
- the trust options in pem format@Deprecated public HttpServerOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class NetServerOptions
options
- the trust options in pfx formatpublic HttpServerOptions addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class NetServerOptions
suite
- the suiteTCPSSLOptions.getEnabledCipherSuites()
public HttpServerOptions removeEnabledCipherSuite(String suite)
TCPSSLOptions
removeEnabledCipherSuite
in class NetServerOptions
suite
- the suitepublic HttpServerOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class NetServerOptions
protocol
- the SSL/TLS protocol to enablepublic HttpServerOptions removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
removeEnabledSecureTransportProtocol
in class NetServerOptions
protocol
- the SSL/TLS protocol to disablepublic HttpServerOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptions
TCP_FASTOPEN
option - only with linux native transport.setTcpFastOpen
in class NetServerOptions
tcpFastOpen
- the fast open valuepublic HttpServerOptions setTcpCork(boolean tcpCork)
TCPSSLOptions
TCP_CORK
option - only with linux native transport.setTcpCork
in class NetServerOptions
tcpCork
- the cork valuepublic HttpServerOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptions
TCP_QUICKACK
option - only with linux native transport.setTcpQuickAck
in class NetServerOptions
tcpQuickAck
- the quick ack valuepublic HttpServerOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class NetServerOptions
crlPath
- the pathNullPointerException
public HttpServerOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class NetServerOptions
crlValue
- the valueNullPointerException
public HttpServerOptions setAcceptBacklog(int acceptBacklog)
NetServerOptions
setAcceptBacklog
in class NetServerOptions
acceptBacklog
- accept backlogpublic HttpServerOptions setPort(int port)
NetServerOptions
setPort
in class NetServerOptions
port
- the portpublic HttpServerOptions setHost(String host)
NetServerOptions
setHost
in class NetServerOptions
host
- the hostpublic HttpServerOptions setClientAuth(ClientAuth clientAuth)
NetServerOptions
setClientAuth
in class NetServerOptions
clientAuth
- One of "NONE, REQUEST, REQUIRED". If it's set to "REQUIRED" then server will require the
SSL cert to be presented otherwise it won't accept the request. If it's set to "REQUEST" then
it won't mandate the certificate to be presented, basically make it optional.public HttpServerOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class NetServerOptions
sslEngineOptions
- the ssl engine to use@Deprecated public HttpServerOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class NetServerOptions
@Deprecated public HttpServerOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class NetServerOptions
public HttpServerOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptions
setEnabledSecureTransportProtocols
in class NetServerOptions
enabledSecureTransportProtocols
- the SSL/TLS protocols to enablepublic HttpServerOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptions
setSslHandshakeTimeout
in class NetServerOptions
sslHandshakeTimeout
- the SSL handshake timeout to set, in millisecondspublic HttpServerOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptions
setSslHandshakeTimeoutUnit
in class NetServerOptions
sslHandshakeTimeoutUnit
- specify time unit.public boolean isCompressionSupported()
true
if the server supports gzip/deflate compressionpublic HttpServerOptions setCompressionSupported(boolean compressionSupported)
compressionSupported
- true
to enable compression supportpublic int getCompressionLevel()
public HttpServerOptions setCompressionLevel(int compressionLevel)
deflate/gzip
compression in the Accept-Encoding
header
default value is : 6 (Netty legacy)
The compression level determines how much the data is compressed on a scale from 1 to 9,
where '9' is trying to achieve the maximum compression ratio while '1' instead is giving
priority to speed instead of compression ratio using some algorithm optimizations and skipping
pedantic loops that usually gives just little improvements
While one can think that best value is always the maximum compression ratio,
there's a trade-off to consider: the most compressed level requires the most
computational work to compress/decompress data, e.g. more dictionary lookups and loops.
E.g. you have it set fairly high on a high-volume website, you may experience performance degradation
and latency on resource serving due to CPU overload, and, however - as the computational work is required also client side
while decompressing - setting an higher compression level can result in an overall higher page load time
especially nowadays when many clients are handled mobile devices with a low CPU profile.
see also: http://www.gzip.org/algorithm.txtcompressionLevel
- integer 1-9, 1 means use fastest algorithm, 9 slower algorithm but better compression ratio@Unstable public List<CompressionOptions> getCompressors()
@Unstable public HttpServerOptions addCompressor(CompressionOptions compressor)
setCompressors(List)
@Unstable public HttpServerOptions setCompressors(List<CompressionOptions> compressors)
setCompressionLevel(int)
configuration.
This is only active when setCompressionSupported(boolean)
is true
.
compressors
- the list of compressorspublic boolean isAcceptUnmaskedFrames()
public HttpServerOptions setAcceptUnmaskedFrames(boolean acceptUnmaskedFrames)
true
when the server accepts unmasked frame.
As default Server doesn't accept unmasked frame, you can bypass this behaviour (RFC 6455) setting true
.
It's set to false
as default.acceptUnmaskedFrames
- true
if enabledpublic int getMaxWebSocketFrameSize()
public HttpServerOptions setMaxWebSocketFrameSize(int maxWebSocketFrameSize)
maxWebSocketFrameSize
- the maximum frame size in bytes.public int getMaxWebSocketMessageSize()
public HttpServerOptions setMaxWebSocketMessageSize(int maxWebSocketMessageSize)
maxWebSocketMessageSize
- the maximum message size in bytes.public HttpServerOptions addWebSocketSubProtocol(String subProtocol)
subProtocol
- the sub-protocol to addpublic HttpServerOptions setWebSocketSubProtocols(List<String> subProtocols)
subProtocols
- comma separated list of sub-protocolspublic List<String> getWebSocketSubProtocols()
public boolean isHandle100ContinueAutomatically()
public HttpServerOptions setHandle100ContinueAutomatically(boolean handle100ContinueAutomatically)
handle100ContinueAutomatically
- true
if it should be handled automaticallypublic HttpServerOptions setMaxChunkSize(int maxChunkSize)
HttpServerRequest.handler(Handler)
will receivemaxChunkSize
- the maximum chunk sizepublic int getMaxChunkSize()
HttpServerRequest.handler(Handler)
will receivepublic int getMaxInitialLineLength()
"GET / HTTP/1.0"
)public HttpServerOptions setMaxInitialLineLength(int maxInitialLineLength)
"GET / HTTP/1.0"
)maxInitialLineLength
- the new maximum initial lengthpublic int getMaxHeaderSize()
public HttpServerOptions setMaxHeaderSize(int maxHeaderSize)
maxHeaderSize
- the new maximum lengthpublic int getMaxFormAttributeSize()
public HttpServerOptions setMaxFormAttributeSize(int maxSize)
-1
to allow unlimited lengthmaxSize
- the new maximum sizepublic int getMaxFormFields()
public HttpServerOptions setMaxFormFields(int maxFormFields)
-1
to allow unlimited number of attributesmaxFormFields
- the new maximumpublic int getMaxFormBufferedBytes()
public HttpServerOptions setMaxFormBufferedBytes(int maxFormBufferedBytes)
-1
to allow unlimited lengthmaxFormBufferedBytes
- the new maximumpublic Http2Settings getInitialSettings()
public HttpServerOptions setInitialSettings(Http2Settings settings)
settings
- the settings valuepublic List<HttpVersion> getAlpnVersions()
public HttpServerOptions setAlpnVersions(List<HttpVersion> alpnVersions)
alpnVersions
- the versionspublic boolean isHttp2ClearTextEnabled()
public HttpServerOptions setHttp2ClearTextEnabled(boolean http2ClearTextEnabled)
http2ClearTextEnabled
- whether to accept HTTP/2 over clear textpublic int getHttp2ConnectionWindowSize()
public HttpServerOptions 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 HttpServerOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class NetServerOptions
logEnabled
- true for logging the network activitypublic HttpServerOptions setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
NetworkOptions
setActivityLogDataFormat
in class NetServerOptions
activityLogDataFormat
- the format to usepublic HttpServerOptions setSni(boolean sni)
NetServerOptions
setSni
in class NetServerOptions
public HttpServerOptions setUseProxyProtocol(boolean useProxyProtocol)
NetServerOptions
setUseProxyProtocol
in class NetServerOptions
public HttpServerOptions setProxyProtocolTimeout(long proxyProtocolTimeout)
NetServerOptions
setProxyProtocolTimeout
in class NetServerOptions
proxyProtocolTimeout
- the Proxy protocol timeout to setpublic HttpServerOptions setProxyProtocolTimeoutUnit(TimeUnit proxyProtocolTimeoutUnit)
NetServerOptions
setProxyProtocolTimeoutUnit
in class NetServerOptions
proxyProtocolTimeoutUnit
- specify time unit.public boolean isDecompressionSupported()
true
if the server supports decompressionpublic HttpServerOptions setDecompressionSupported(boolean decompressionSupported)
decompressionSupported
- true
if decompression supportedpublic int getDecoderInitialBufferSize()
public HttpServerOptions setDecoderInitialBufferSize(int decoderInitialBufferSize)
decoderInitialBufferSize
- the initial sizepublic HttpServerOptions setPerFrameWebSocketCompressionSupported(boolean supported)
supported
- true
when the per-frame deflate compression extension is supportedpublic boolean getPerFrameWebSocketCompressionSupported()
true
if the http server will accept the per-frame deflate compression extensionpublic HttpServerOptions setPerMessageWebSocketCompressionSupported(boolean supported)
supported
- true
when the per-message WebSocket compression extension is supportedpublic boolean getPerMessageWebSocketCompressionSupported()
true
if the http server will accept the per-message deflate compression extensionpublic HttpServerOptions setWebSocketCompressionLevel(int compressionLevel)
compressionLevel
- the compression levelpublic int getWebSocketCompressionLevel()
public HttpServerOptions setWebSocketAllowServerNoContext(boolean accept)
server_no_context_takeover
parameter of the per-message
deflate compression extension offered by the client.accept
- true
to accept the server_no_context_takeover parameter when the client offers itpublic boolean getWebSocketAllowServerNoContext()
true
when the WebSocket server will accept the server_no_context_takeover
parameter for the per-message
deflate compression extension offered by the clientpublic HttpServerOptions setWebSocketPreferredClientNoContext(boolean accept)
client_no_context_takeover
parameter of the per-message
deflate compression extension offered by the client.accept
- true
to accept the client_no_context_takeover
parameter when the client offers itpublic boolean getWebSocketPreferredClientNoContext()
true
when the WebSocket server will accept the client_no_context_takeover
parameter for the per-message
deflate compression extension offered by the clientpublic int getWebSocketClosingTimeout()
public HttpServerOptions setWebSocketClosingTimeout(int webSocketClosingTimeout)
When a server closes a WebSocket, it should wait the client close frame to close the TCP connection.
This timeout will close the TCP connection on the server when it expires. When the TCP
connection is closed receiving the close frame, the WebSocket.exceptionHandler(io.vertx.core.Handler<java.lang.Throwable>)
instead
of the WebSocket.endHandler(io.vertx.core.Handler<java.lang.Void>)
will be called.
Set to 0L
closes the TCP connection immediately after sending the close frame.
Set to a negative value to disable it.
webSocketClosingTimeout
- the timeout is secondspublic HttpServerOptions setTrafficShapingOptions(TrafficShapingOptions trafficShapingOptions)
NetServerOptions
setTrafficShapingOptions
in class NetServerOptions
trafficShapingOptions
- options used by traffic handlerpublic TracingPolicy getTracingPolicy()
public HttpServerOptions setTracingPolicy(TracingPolicy tracingPolicy)
tracingPolicy
- the tracing policypublic boolean isRegisterWriteHandler()
isRegisterWriteHandler
in class NetServerOptions
false
, does not apply to HTTP serverspublic HttpServerOptions setRegisterWriteHandler(boolean registerWriteHandler)
setRegisterWriteHandler
in class NetServerOptions
registerWriteHandler
- true to register a write-handlerNetSocket.writeHandlerID()
public boolean isRegisterWebSocketWriteHandlers()
true
if write-handlers for server websockets should be registered on the EventBus
, otherwise false
public HttpServerOptions setRegisterWebSocketWriteHandlers(boolean registerWebSocketWriteHandlers)
EventBus
.
Defaults to false
.
registerWebSocketWriteHandlers
- true to register write-handlersWebSocketBase.textHandlerID()
,
WebSocketBase.binaryHandlerID()
public int getHttp2RstFloodMaxRstFramePerWindow()
public HttpServerOptions setHttp2RstFloodMaxRstFramePerWindow(int http2RstFloodMaxRstFramePerWindow)
DEFAULT_HTTP2_RST_FLOOD_MAX_RST_FRAME_PER_WINDOW
, setting zero or a negative value, disables flood protection.http2RstFloodMaxRstFramePerWindow
- the new maximumpublic int getHttp2RstFloodWindowDuration()
public HttpServerOptions setHttp2RstFloodWindowDuration(int http2RstFloodWindowDuration)
DEFAULT_HTTP2_RST_FLOOD_WINDOW_DURATION
, setting zero or a negative value, disables flood protection.http2RstFloodWindowDuration
- the new durationpublic TimeUnit getHttp2RstFloodWindowDurationTimeUnit()
public HttpServerOptions setHttp2RstFloodWindowDurationTimeUnit(TimeUnit http2RstFloodWindowDurationTimeUnit)
DEFAULT_HTTP2_RST_FLOOD_WINDOW_DURATION_TIME_UNIT
,
setting zero or a negative value, disables the flood protection.http2RstFloodWindowDurationTimeUnit
- the new durationCopyright © 2024 Eclipse. All rights reserved.