Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpServerOptions

Represents options used by an HttpServer instance

Hierarchy

Index

Constructors

Methods

Constructors

constructor

Methods

addCompressor

  • Set the list of compressor to use instead of using the default gzip/deflate HttpServerOptions configuration.

    This is only active when HttpServerOptions is true.

    Parameters

    • compressors: any

    Returns HttpServerOptions

addCrlPath

addCrlValue

addEnabledCipherSuite

addEnabledSecureTransportProtocol

  • addEnabledSecureTransportProtocol(enabledSecureTransportProtocols: string): HttpServerOptions

addWebSocketSubProtocol

  • Set the WebSocket list of sub-protocol supported by the server.

    Parameters

    • webSocketSubProtocols: string

    Returns HttpServerOptions

getAcceptBacklog

  • getAcceptBacklog(): number

getActivityLogDataFormat

  • getActivityLogDataFormat(): any
  • Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.

    Returns any

getAlpnVersions

  • Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiatiation.

    Returns HttpVersion[]

getClientAuth

getCompressionLevel

  • getCompressionLevel(): number
  • 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. 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.txt

    Returns number

getCompressors

  • getCompressors(): any[]
  • Set the list of compressor to use instead of using the default gzip/deflate HttpServerOptions configuration.

    This is only active when HttpServerOptions is true.

    Returns any[]

getCrlPaths

  • getCrlPaths(): string[]
  • Add a CRL path

    Returns string[]

getCrlValues

getDecoderInitialBufferSize

  • getDecoderInitialBufferSize(): number
  • Set the initial buffer size for the HTTP decoder

    Returns number

getEnabledCipherSuites

  • getEnabledCipherSuites(): string[]
  • Add an enabled cipher suite, appended to the ordered suites.

    Returns string[]

getEnabledSecureTransportProtocols

  • getEnabledSecureTransportProtocols(): string[]

getHost

  • getHost(): string
  • Set the host

    Returns string

getHttp2ConnectionWindowSize

  • getHttp2ConnectionWindowSize(): number
  • Set the default HTTP/2 connection window size. It overrides the initial window size set by Http2Settings, 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.

    Returns number

getIdleTimeout

  • getIdleTimeout(): number
  • Set the idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received nor sent within the timeout.

    If you want change default time unit, use HttpServerOptions

    Returns number

getIdleTimeoutUnit

  • getIdleTimeoutUnit(): any
  • Set the idle timeout unit. If not specified, default is seconds.

    Returns any

getInitialSettings

  • Set the HTTP/2 connection settings immediatly sent by the server when a client connects.

    Returns Http2Settings

getJdkSslEngineOptions

getKeyStoreOptions

getLogActivity

  • getLogActivity(): boolean
  • Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.

    Returns boolean

getMaxChunkSize

  • getMaxChunkSize(): number
  • Set the maximum HTTP chunk size that {@link HttpServerRequest#handler} will receive

    Returns number

getMaxFormAttributeSize

  • getMaxFormAttributeSize(): number
  • Set the maximum size of a form attribute. Set to -1 to allow unlimited length

    Returns number

getMaxHeaderSize

  • getMaxHeaderSize(): number
  • Set the maximum length of all headers for HTTP/1.x .

    Returns number

getMaxInitialLineLength

  • getMaxInitialLineLength(): number
  • Set the maximum length of the initial line for HTTP/1.x (e.g. "GET / HTTP/1.0")

    Returns number

getMaxWebSocketFrameSize

  • getMaxWebSocketFrameSize(): number
  • Set the maximum WebSocket frames size

    Returns number

getMaxWebSocketMessageSize

  • getMaxWebSocketMessageSize(): number
  • Set the maximum WebSocket message size

    Returns number

getOpenSslEngineOptions

getPemKeyCertOptions

getPemTrustOptions

getPerFrameWebSocketCompressionSupported

  • getPerFrameWebSocketCompressionSupported(): boolean
  • Enable or disable support for the WebSocket per-frame deflate compression extension.

    Returns boolean

getPerMessageWebSocketCompressionSupported

  • getPerMessageWebSocketCompressionSupported(): boolean
  • Enable or disable support for WebSocket per-message deflate compression extension.

    Returns boolean

getPfxKeyCertOptions

getPfxTrustOptions

getPort

  • getPort(): number
  • Set the port

    Returns number

getProxyProtocolTimeout

  • getProxyProtocolTimeout(): number
  • Set the Proxy protocol timeout, default time unit is seconds.

    Returns number

getProxyProtocolTimeoutUnit

  • getProxyProtocolTimeoutUnit(): any

getReadIdleTimeout

  • getReadIdleTimeout(): number
  • Set the read idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout.

    If you want change default time unit, use HttpServerOptions

    Returns number

getReceiveBufferSize

  • getReceiveBufferSize(): number

getSendBufferSize

  • getSendBufferSize(): number

getSoLinger

  • getSoLinger(): number
  • Set whether SO_linger keep alive is enabled

    Returns number

getSslEngineOptions

getSslHandshakeTimeout

  • getSslHandshakeTimeout(): number
  • Set the SSL handshake timeout, default time unit is seconds.

    Returns number

getSslHandshakeTimeoutUnit

  • getSslHandshakeTimeoutUnit(): any
  • Set the SSL handshake timeout unit. If not specified, default is seconds.

    Returns any

getTcpUserTimeout

  • getTcpUserTimeout(): number
  • Sets the TCP_USER_TIMEOUT option - only with linux native transport.

    Returns number

getTracingPolicy

  • Set the tracing policy for the server behavior when Vert.x has tracing enabled.

    Returns TracingPolicy

getTrafficClass

  • getTrafficClass(): number
  • Set the value of traffic class

    Returns number

getTrustOptions

getTrustStoreOptions

getWebSocketAllowServerNoContext

  • getWebSocketAllowServerNoContext(): boolean
  • Set whether the WebSocket server will accept the server_no_context_takeover parameter of the per-message deflate compression extension offered by the client.

    Returns boolean

getWebSocketClosingTimeout

  • getWebSocketClosingTimeout(): number
  • Set the amount of time a server WebSocket will wait until it closes the TCP connection after sending a close frame.

    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 {@link WebSocket#exceptionHandler} instead of the {@link WebSocket#endHandler} will be called.

    Set to 0L closes the TCP connection immediately after sending the close frame.

    Set to a negative value to disable it.

    Returns number

getWebSocketCompressionLevel

  • getWebSocketCompressionLevel(): number
  • Set the WebSocket compression level.

    Returns number

getWebSocketPreferredClientNoContext

  • getWebSocketPreferredClientNoContext(): boolean
  • Set whether the WebSocket server will accept the client_no_context_takeover parameter of the per-message deflate compression extension offered by the client.

    Returns boolean

getWebSocketSubProtocols

  • getWebSocketSubProtocols(): string[]
  • Set the WebSocket list of sub-protocol supported by the server.

    Returns string[]

getWriteIdleTimeout

  • getWriteIdleTimeout(): number
  • Set the write idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is sent within the timeout.

    If you want change default time unit, use HttpServerOptions

    Returns number

isAcceptUnmaskedFrames

  • isAcceptUnmaskedFrames(): boolean
  • Set 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.

    Returns boolean

isCompressionSupported

  • isCompressionSupported(): boolean
  • Set whether the server should support gzip/deflate compression (serving compressed responses to clients advertising support for them with Accept-Encoding header)

    Returns boolean

isDecompressionSupported

  • isDecompressionSupported(): boolean
  • Set whether the server supports decompression

    Returns boolean

isHandle100ContinueAutomatically

  • isHandle100ContinueAutomatically(): boolean
  • Set whether 100 Continue should be handled automatically

    Returns boolean

isRegisterWebSocketWriteHandlers

  • isRegisterWebSocketWriteHandlers(): boolean
  • Whether write-handlers for server websockets should be registered on the EventBus.

    Defaults to false.

    Returns boolean

isRegisterWriteHandler

  • isRegisterWriteHandler(): boolean

isReuseAddress

  • isReuseAddress(): boolean
  • Set the value of reuse address

    Returns boolean

isReusePort

  • isReusePort(): boolean
  • Set the value of reuse port.

    This is only supported by native transports.

    Returns boolean

isSni

  • isSni(): boolean
  • Set whether the server supports Server Name Indiciation

    Returns boolean

isSsl

  • isSsl(): boolean
  • Set whether SSL/TLS is enabled

    Returns boolean

isTcpCork

  • isTcpCork(): boolean
  • Enable the TCP_CORK option - only with linux native transport.

    Returns boolean

isTcpFastOpen

  • isTcpFastOpen(): boolean
  • Enable the TCP_FASTOPEN option - only with linux native transport.

    Returns boolean

isTcpKeepAlive

  • isTcpKeepAlive(): boolean
  • Set whether TCP keep alive is enabled

    Returns boolean

isTcpNoDelay

  • isTcpNoDelay(): boolean
  • Set whether TCP no delay is enabled

    Returns boolean

isTcpQuickAck

  • isTcpQuickAck(): boolean
  • Enable the TCP_QUICKACK option - only with linux native transport.

    Returns boolean

isUseAlpn

  • isUseAlpn(): boolean
  • Set the ALPN usage.

    Returns boolean

isUseProxyProtocol

  • isUseProxyProtocol(): boolean
  • Set whether the server uses the HA Proxy protocol

    Returns boolean

setAcceptBacklog

setAcceptUnmaskedFrames

  • Set 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.

    Parameters

    • acceptUnmaskedFrames: boolean

    Returns HttpServerOptions

setActivityLogDataFormat

  • Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.

    Parameters

    • activityLogDataFormat: any

    Returns HttpServerOptions

setAlpnVersions

  • Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiatiation.

    Parameters

    Returns HttpServerOptions

setClientAuth

setCompressionLevel

  • 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. 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.txt

    Parameters

    • compressionLevel: number

    Returns HttpServerOptions

setCompressionSupported

  • Set whether the server should support gzip/deflate compression (serving compressed responses to clients advertising support for them with Accept-Encoding header)

    Parameters

    • compressionSupported: boolean

    Returns HttpServerOptions

setCompressors

  • Set the list of compressor to use instead of using the default gzip/deflate HttpServerOptions configuration.

    This is only active when HttpServerOptions is true.

    Parameters

    • compressors: any[]

    Returns HttpServerOptions

setDecoderInitialBufferSize

  • Set the initial buffer size for the HTTP decoder

    Parameters

    • decoderInitialBufferSize: number

    Returns HttpServerOptions

setDecompressionSupported

  • Set whether the server supports decompression

    Parameters

    • decompressionSupported: boolean

    Returns HttpServerOptions

setEnabledSecureTransportProtocols

  • setEnabledSecureTransportProtocols(enabledSecureTransportProtocols: string[]): HttpServerOptions

setHandle100ContinueAutomatically

  • setHandle100ContinueAutomatically(handle100ContinueAutomatically: boolean): HttpServerOptions
  • Set whether 100 Continue should be handled automatically

    Parameters

    • handle100ContinueAutomatically: boolean

    Returns HttpServerOptions

setHost

setHttp2ConnectionWindowSize

  • Set the default HTTP/2 connection window size. It overrides the initial window size set by Http2Settings, 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.

    Parameters

    • http2ConnectionWindowSize: number

    Returns HttpServerOptions

setIdleTimeout

  • Set the idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received nor sent within the timeout.

    If you want change default time unit, use HttpServerOptions

    Parameters

    • idleTimeout: number

    Returns HttpServerOptions

setIdleTimeoutUnit

setInitialSettings

  • Set the HTTP/2 connection settings immediatly sent by the server when a client connects.

    Parameters

    Returns HttpServerOptions

setJdkSslEngineOptions

setKeyCertOptions

setKeyStoreOptions

setLogActivity

  • Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.

    Parameters

    • logActivity: boolean

    Returns HttpServerOptions

setMaxChunkSize

  • Set the maximum HTTP chunk size that {@link HttpServerRequest#handler} will receive

    Parameters

    • maxChunkSize: number

    Returns HttpServerOptions

setMaxFormAttributeSize

  • Set the maximum size of a form attribute. Set to -1 to allow unlimited length

    Parameters

    • maxFormAttributeSize: number

    Returns HttpServerOptions

setMaxHeaderSize

  • Set the maximum length of all headers for HTTP/1.x .

    Parameters

    • maxHeaderSize: number

    Returns HttpServerOptions

setMaxInitialLineLength

  • Set the maximum length of the initial line for HTTP/1.x (e.g. "GET / HTTP/1.0")

    Parameters

    • maxInitialLineLength: number

    Returns HttpServerOptions

setMaxWebSocketFrameSize

  • Set the maximum WebSocket frames size

    Parameters

    • maxWebSocketFrameSize: number

    Returns HttpServerOptions

setMaxWebSocketMessageSize

  • Set the maximum WebSocket message size

    Parameters

    • maxWebSocketMessageSize: number

    Returns HttpServerOptions

setOpenSslEngineOptions

setPemKeyCertOptions

setPemTrustOptions

setPerFrameWebSocketCompressionSupported

  • setPerFrameWebSocketCompressionSupported(perFrameWebSocketCompressionSupported: boolean): HttpServerOptions
  • Enable or disable support for the WebSocket per-frame deflate compression extension.

    Parameters

    • perFrameWebSocketCompressionSupported: boolean

    Returns HttpServerOptions

setPerMessageWebSocketCompressionSupported

  • setPerMessageWebSocketCompressionSupported(perMessageWebSocketCompressionSupported: boolean): HttpServerOptions
  • Enable or disable support for WebSocket per-message deflate compression extension.

    Parameters

    • perMessageWebSocketCompressionSupported: boolean

    Returns HttpServerOptions

setPfxKeyCertOptions

setPfxTrustOptions

setPort

setProxyProtocolTimeout

setProxyProtocolTimeoutUnit

setReadIdleTimeout

  • Set the read idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout.

    If you want change default time unit, use HttpServerOptions

    Parameters

    • readIdleTimeout: number

    Returns HttpServerOptions

setReceiveBufferSize

setRegisterWebSocketWriteHandlers

  • setRegisterWebSocketWriteHandlers(registerWebSocketWriteHandlers: boolean): HttpServerOptions
  • Whether write-handlers for server websockets should be registered on the EventBus.

    Defaults to false.

    Parameters

    • registerWebSocketWriteHandlers: boolean

    Returns HttpServerOptions

setRegisterWriteHandler

setReuseAddress

setReusePort

  • Set the value of reuse port.

    This is only supported by native transports.

    Parameters

    • reusePort: boolean

    Returns HttpServerOptions

setSendBufferSize

setSni

  • Set whether the server supports Server Name Indiciation

    Parameters

    • sni: boolean

    Returns HttpServerOptions

setSoLinger

setSsl

setSslEngineOptions

setSslHandshakeTimeout

setSslHandshakeTimeoutUnit

setTcpCork

  • Enable the TCP_CORK option - only with linux native transport.

    Parameters

    • tcpCork: boolean

    Returns HttpServerOptions

setTcpFastOpen

  • Enable the TCP_FASTOPEN option - only with linux native transport.

    Parameters

    • tcpFastOpen: boolean

    Returns HttpServerOptions

setTcpKeepAlive

setTcpNoDelay

setTcpQuickAck

  • Enable the TCP_QUICKACK option - only with linux native transport.

    Parameters

    • tcpQuickAck: boolean

    Returns HttpServerOptions

setTcpUserTimeout

setTracingPolicy

  • Set the tracing policy for the server behavior when Vert.x has tracing enabled.

    Parameters

    Returns HttpServerOptions

setTrafficClass

setTrustOptions

setTrustStoreOptions

setUseAlpn

setUseProxyProtocol

setWebSocketAllowServerNoContext

  • setWebSocketAllowServerNoContext(webSocketAllowServerNoContext: boolean): HttpServerOptions
  • Set whether the WebSocket server will accept the server_no_context_takeover parameter of the per-message deflate compression extension offered by the client.

    Parameters

    • webSocketAllowServerNoContext: boolean

    Returns HttpServerOptions

setWebSocketClosingTimeout

  • Set the amount of time a server WebSocket will wait until it closes the TCP connection after sending a close frame.

    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 {@link WebSocket#exceptionHandler} instead of the {@link WebSocket#endHandler} will be called.

    Set to 0L closes the TCP connection immediately after sending the close frame.

    Set to a negative value to disable it.

    Parameters

    • webSocketClosingTimeout: number

    Returns HttpServerOptions

setWebSocketCompressionLevel

  • Set the WebSocket compression level.

    Parameters

    • webSocketCompressionLevel: number

    Returns HttpServerOptions

setWebSocketPreferredClientNoContext

  • setWebSocketPreferredClientNoContext(webSocketPreferredClientNoContext: boolean): HttpServerOptions
  • Set whether the WebSocket server will accept the client_no_context_takeover parameter of the per-message deflate compression extension offered by the client.

    Parameters

    • webSocketPreferredClientNoContext: boolean

    Returns HttpServerOptions

setWebSocketSubProtocols

  • Set the WebSocket list of sub-protocol supported by the server.

    Parameters

    • webSocketSubProtocols: string[]

    Returns HttpServerOptions

setWriteIdleTimeout

  • Set the write idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is sent within the timeout.

    If you want change default time unit, use HttpServerOptions

    Parameters

    • writeIdleTimeout: number

    Returns HttpServerOptions

toJson

  • toJson(): {}
  • Returns {}

    • [key: string]: any

Generated using TypeDoc