public class HttpServerOptions extends NetServerOptions
HttpServer instance| Modifier and Type | Field and Description |
|---|---|
static List<HttpVersion> |
DEFAULT_ALPN_VERSIONS
Default Application-Layer Protocol Negotiation versions = [HTTP/2,HTTP/1.1]
|
static boolean |
DEFAULT_COMPRESSION_SUPPORTED
Default value of whether compression is supported = false
|
static boolean |
DEFAULT_HANDLE_100_CONTINE_AUTOMATICALLY
Default value of whether 100-Continue should be handled automatically
|
static int |
DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE |
static long |
DEFAULT_INITIAL_SETTINGS_MAX_CONCURRENT_STREAMS
The default inital 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_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 framesize = 65536
|
static int |
DEFAULT_PORT
Default port the server will listen on = 80
|
DEFAULT_ACCEPT_BACKLOG, DEFAULT_CLIENT_AUTH, DEFAULT_HOSTDEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_ALPN, DEFAULT_USE_POOLED_BUFFERSDEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, 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 |
addCrlPath(String crlPath)
Add a CRL path
|
HttpServerOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
HttpServerOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite
|
HttpServerOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols
|
boolean |
equals(Object o) |
List<HttpVersion> |
getAlpnVersions() |
int |
getHttp2ConnectionWindowSize() |
Http2Settings |
getInitialSettings() |
int |
getMaxChunkSize()
Returns the maximum HTTP chunk size
|
int |
getMaxHeaderSize() |
int |
getMaxInitialLineLength() |
int |
getMaxWebsocketFrameSize() |
String |
getWebsocketSubProtocols() |
int |
hashCode() |
boolean |
isCompressionSupported() |
boolean |
isHandle100ContinueAutomatically() |
HttpServerOptions |
setAcceptBacklog(int acceptBacklog)
Set the accept back log
|
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 |
setClientAuthRequired(boolean clientAuthRequired)
Deprecated.
|
HttpServerOptions |
setCompressionSupported(boolean compressionSupported)
Set whether the server supports compression
|
HttpServerOptions |
setHandle100ContinueAutomatically(boolean handle100ContinueAutomatically)
Set whether 100 Continue should be handled automatically
|
HttpServerOptions |
setHost(String host)
Set the host
|
HttpServerOptions |
setHttp2ConnectionWindowSize(int http2ConnectionWindowSize)
Set the default HTTP/2 connection window size.
|
HttpServerOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, in seconds.
|
HttpServerOptions |
setInitialSettings(Http2Settings settings)
Set the HTTP/2 connection settings immediatly sent by the server when a client connects.
|
HttpServerOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
HttpServerOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
HttpServerOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
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
|
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 |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
HttpServerOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
HttpServerOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
HttpServerOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
HttpServerOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
HttpServerOptions |
setPort(int port)
Set the port
|
HttpServerOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
HttpServerOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
HttpServerOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
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 |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
HttpServerOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
HttpServerOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
HttpServerOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
HttpServerOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java trustore
|
HttpServerOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
HttpServerOptions |
setUsePooledBuffers(boolean usePooledBuffers)
Set whether Netty pooled buffers are enabled
|
HttpServerOptions |
setWebsocketSubProtocols(String subProtocols)
Set the websocket subprotocols supported by the server.
|
getAcceptBacklog, getClientAuth, getHost, getPort, isClientAuthRequiredgetCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getKeyCertOptions, getSoLinger, getSslEngineOptions, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffersgetLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddresspublic static final int DEFAULT_PORT
public static final boolean DEFAULT_COMPRESSION_SUPPORTED
public static final int DEFAULT_MAX_WEBSOCKET_FRAME_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 boolean DEFAULT_HANDLE_100_CONTINE_AUTOMATICALLY
public static final List<HttpVersion> DEFAULT_ALPN_VERSIONS
public static final long DEFAULT_INITIAL_SETTINGS_MAX_CONCURRENT_STREAMS
public static final int DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
public HttpServerOptions()
public HttpServerOptions(HttpServerOptions other)
other - the options to copypublic HttpServerOptions(JsonObject json)
json - the JSONpublic HttpServerOptions setSendBufferSize(int sendBufferSize)
NetworkOptionssetSendBufferSize in class NetServerOptionssendBufferSize - the buffers size, in bytespublic HttpServerOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptionssetReceiveBufferSize in class NetServerOptionsreceiveBufferSize - the buffers size, in bytespublic HttpServerOptions setReuseAddress(boolean reuseAddress)
NetworkOptionssetReuseAddress in class NetServerOptionsreuseAddress - the value of reuse addresspublic HttpServerOptions setTrafficClass(int trafficClass)
NetworkOptionssetTrafficClass in class NetServerOptionstrafficClass - the value of traffic classpublic HttpServerOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptionssetTcpNoDelay in class NetServerOptionstcpNoDelay - true if TCP no delay is enabled (Nagle disabled)public HttpServerOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptionssetTcpKeepAlive in class NetServerOptionstcpKeepAlive - true if TCP keep alive is enabledpublic HttpServerOptions setSoLinger(int soLinger)
TCPSSLOptionssetSoLinger in class NetServerOptionssoLinger - true if SO_linger is enabledpublic HttpServerOptions setUsePooledBuffers(boolean usePooledBuffers)
TCPSSLOptionssetUsePooledBuffers in class NetServerOptionsusePooledBuffers - true if pooled buffers enabledpublic HttpServerOptions setIdleTimeout(int idleTimeout)
TCPSSLOptionssetIdleTimeout in class NetServerOptionsidleTimeout - the timeout, in secondspublic HttpServerOptions setSsl(boolean ssl)
TCPSSLOptionssetSsl in class NetServerOptionsssl - true if enabledpublic HttpServerOptions setUseAlpn(boolean useAlpn)
TCPSSLOptionssetUseAlpn in class NetServerOptionsuseAlpn - true when Application-Layer Protocol Negotiation should be usedpublic HttpServerOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptionssetKeyCertOptions in class NetServerOptionsoptions - the key store optionspublic HttpServerOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptionssetKeyStoreOptions in class NetServerOptionsoptions - the key store in jks formatpublic HttpServerOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptionssetPfxKeyCertOptions in class NetServerOptionsoptions - the key cert options in pfx formatpublic HttpServerOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptionssetPemKeyCertOptions in class NetServerOptionsoptions - the options in pem formatpublic HttpServerOptions setTrustOptions(TrustOptions options)
TCPSSLOptionssetTrustOptions in class NetServerOptionsoptions - the trust optionspublic HttpServerOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptionssetTrustStoreOptions in class NetServerOptionsoptions - the trust options in jks formatpublic HttpServerOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptionssetPemTrustOptions in class NetServerOptionsoptions - the trust options in pem formatpublic HttpServerOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptionssetPfxTrustOptions in class NetServerOptionsoptions - the trust options in pfx formatpublic HttpServerOptions addEnabledCipherSuite(String suite)
TCPSSLOptionsaddEnabledCipherSuite in class NetServerOptionssuite - the suitepublic HttpServerOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptionsaddEnabledSecureTransportProtocol in class NetServerOptionsprotocol - the SSL/TLS protocol do enabledpublic HttpServerOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptionsaddCrlPath in class NetServerOptionscrlPath - the pathNullPointerExceptionpublic HttpServerOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptionsaddCrlValue in class NetServerOptionscrlValue - the valueNullPointerExceptionpublic HttpServerOptions setAcceptBacklog(int acceptBacklog)
NetServerOptionssetAcceptBacklog in class NetServerOptionsacceptBacklog - accept backlogpublic HttpServerOptions setPort(int port)
NetServerOptionssetPort in class NetServerOptionsport - the portpublic HttpServerOptions setHost(String host)
NetServerOptionssetHost in class NetServerOptionshost - the host@Deprecated public HttpServerOptions setClientAuthRequired(boolean clientAuthRequired)
NetServerOptionssetClientAuthRequired in class NetServerOptionsclientAuthRequired - true if client auth is requiredpublic HttpServerOptions setClientAuth(ClientAuth clientAuth)
NetServerOptionssetClientAuth in class NetServerOptionsclientAuth - 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)
TCPSSLOptionssetSslEngineOptions in class NetServerOptionssslEngineOptions - the ssl engine to usepublic HttpServerOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions in class NetServerOptionspublic HttpServerOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions in class NetServerOptionspublic boolean isCompressionSupported()
public HttpServerOptions setCompressionSupported(boolean compressionSupported)
compressionSupported - true if compression supportedpublic int getMaxWebsocketFrameSize()
public HttpServerOptions setMaxWebsocketFrameSize(int maxWebsocketFrameSize)
maxWebsocketFrameSize - the maximum frame size in bytes.public HttpServerOptions setWebsocketSubProtocols(String subProtocols)
subProtocols - comma separated list of subprotocolspublic String getWebsocketSubProtocols()
public boolean isHandle100ContinueAutomatically()
public HttpServerOptions setHandle100ContinueAutomatically(boolean handle100ContinueAutomatically)
handle100ContinueAutomatically - true if it should be handled automaticallypublic HttpServerOptions setMaxChunkSize(int maxChunkSize)
maxChunkSize - the maximum chunk sizepublic int getMaxChunkSize()
public 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 Http2Settings getInitialSettings()
public HttpServerOptions setInitialSettings(Http2Settings settings)
settings - the settings valuepublic List<HttpVersion> getAlpnVersions()
public HttpServerOptions setAlpnVersions(List<HttpVersion> alpnVersions)
alpnVersions - the versionspublic 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)
NetworkOptionssetLogActivity in class NetServerOptionslogEnabled - true for logging the network activitypublic boolean equals(Object o)
equals in class NetServerOptionspublic int hashCode()
hashCode in class NetServerOptionsCopyright © 2016. All rights reserved.