Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Server

Hierarchy

Index

Constructors

constructor

  • new Server(requestListener?: http.RequestListener): Server
  • new Server(options: ServerOptions, requestListener?: http.RequestListener): Server
  • Parameters

    • Optional requestListener: http.RequestListener

    Returns Server

  • Parameters

    • options: ServerOptions
    • Optional requestListener: http.RequestListener

    Returns Server

Properties

connections

connections: number

headersTimeout

headersTimeout: number

Limit the amount of time the parser will wait to receive the complete HTTP headers.

default

40000 https://nodejs.org/api/http.html#http_server_headerstimeout

keepAliveTimeout

keepAliveTimeout: number

listening

listening: boolean

maxConnections

maxConnections: number

maxHeadersCount

maxHeadersCount: number | null

Limits maximum incoming headers count. If set to 0, no limit will be applied.

default

2000 https://nodejs.org/api/http.html#http_server_maxheaderscount

timeout

timeout: number

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addContext

addListener

  • addListener(event: string, listener: function): this
  • addListener(event: "tlsClientError", listener: function): this
  • addListener(event: "newSession", listener: function): this
  • addListener(event: "OCSPRequest", listener: function): this
  • addListener(event: "resumeSession", listener: function): this
  • addListener(event: "secureConnection", listener: function): this
  • addListener(event: "keylog", listener: function): this
  • events.EventEmitter

    1. tlsClientError
    2. newSession
    3. OCSPRequest
    4. resumeSession
    5. secureConnection

    Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "tlsClientError"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "newSession"
    • listener: function
        • (sessionId: Buffer, sessionData: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • sessionData: Buffer
          • callback: function
              • (err: Error, resp: Buffer): void
              • Parameters

                • err: Error
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "OCSPRequest"
    • listener: function
        • (certificate: Buffer, issuer: Buffer, callback: function): void
        • Parameters

          • certificate: Buffer
          • issuer: Buffer
          • callback: function
              • (err: Error | null, resp: Buffer): void
              • Parameters

                • err: Error | null
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "resumeSession"
    • listener: function
        • (sessionId: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • callback: function
              • (err: Error, sessionData: Buffer): void
              • Parameters

                • err: Error
                • sessionData: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "secureConnection"
    • listener: function

    Returns this

  • Parameters

    • event: "keylog"
    • listener: function
        • Parameters

          Returns void

    Returns this

address

close

  • close(callback?: function): this
  • Parameters

    • Optional callback: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns this

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean
  • emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: function): boolean
  • emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: function): boolean
  • emit(event: "resumeSession", sessionId: Buffer, callback: function): boolean
  • emit(event: "secureConnection", tlsSocket: TLSSocket): boolean
  • emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • event: "tlsClientError"
    • err: Error
    • tlsSocket: TLSSocket

    Returns boolean

  • Parameters

    • event: "newSession"
    • sessionId: Buffer
    • sessionData: Buffer
    • callback: function
        • (err: Error, resp: Buffer): void
        • Parameters

          • err: Error
          • resp: Buffer

          Returns void

    Returns boolean

  • Parameters

    • event: "OCSPRequest"
    • certificate: Buffer
    • issuer: Buffer
    • callback: function
        • (err: Error | null, resp: Buffer): void
        • Parameters

          • err: Error | null
          • resp: Buffer

          Returns void

    Returns boolean

  • Parameters

    • event: "resumeSession"
    • sessionId: Buffer
    • callback: function
        • (err: Error, sessionData: Buffer): void
        • Parameters

          • err: Error
          • sessionData: Buffer

          Returns void

    Returns boolean

  • Parameters

    • event: "secureConnection"
    • tlsSocket: TLSSocket

    Returns boolean

  • Parameters

    • event: "keylog"
    • line: Buffer
    • tlsSocket: TLSSocket

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getConnections

  • getConnections(cb: function): void
  • Parameters

    • cb: function
        • (error: Error | null, count: number): void
        • Parameters

          • error: Error | null
          • count: number

          Returns void

    Returns void

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listen

  • listen(port?: number, hostname?: string, backlog?: number, listeningListener?: function): this
  • listen(port?: number, hostname?: string, listeningListener?: function): this
  • listen(port?: number, backlog?: number, listeningListener?: function): this
  • listen(port?: number, listeningListener?: function): this
  • listen(path: string, backlog?: number, listeningListener?: function): this
  • listen(path: string, listeningListener?: function): this
  • listen(options: ListenOptions, listeningListener?: function): this
  • listen(handle: any, backlog?: number, listeningListener?: function): this
  • listen(handle: any, listeningListener?: function): this
  • Parameters

    • Optional port: number
    • Optional hostname: string
    • Optional backlog: number
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • Optional port: number
    • Optional hostname: string
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • Optional port: number
    • Optional backlog: number
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • Optional port: number
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • path: string
    • Optional backlog: number
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • path: string
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • options: ListenOptions
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • handle: any
    • Optional backlog: number
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • handle: any
    • Optional listeningListener: function
        • (): void
        • Returns void

    Returns this

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string, listener: function): this
  • on(event: "tlsClientError", listener: function): this
  • on(event: "newSession", listener: function): this
  • on(event: "OCSPRequest", listener: function): this
  • on(event: "resumeSession", listener: function): this
  • on(event: "secureConnection", listener: function): this
  • on(event: "keylog", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "tlsClientError"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "newSession"
    • listener: function
        • (sessionId: Buffer, sessionData: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • sessionData: Buffer
          • callback: function
              • (err: Error, resp: Buffer): void
              • Parameters

                • err: Error
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "OCSPRequest"
    • listener: function
        • (certificate: Buffer, issuer: Buffer, callback: function): void
        • Parameters

          • certificate: Buffer
          • issuer: Buffer
          • callback: function
              • (err: Error | null, resp: Buffer): void
              • Parameters

                • err: Error | null
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "resumeSession"
    • listener: function
        • (sessionId: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • callback: function
              • (err: Error, sessionData: Buffer): void
              • Parameters

                • err: Error
                • sessionData: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "secureConnection"
    • listener: function

    Returns this

  • Parameters

    • event: "keylog"
    • listener: function
        • Parameters

          Returns void

    Returns this

once

  • once(event: string, listener: function): this
  • once(event: "tlsClientError", listener: function): this
  • once(event: "newSession", listener: function): this
  • once(event: "OCSPRequest", listener: function): this
  • once(event: "resumeSession", listener: function): this
  • once(event: "secureConnection", listener: function): this
  • once(event: "keylog", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "tlsClientError"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "newSession"
    • listener: function
        • (sessionId: Buffer, sessionData: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • sessionData: Buffer
          • callback: function
              • (err: Error, resp: Buffer): void
              • Parameters

                • err: Error
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "OCSPRequest"
    • listener: function
        • (certificate: Buffer, issuer: Buffer, callback: function): void
        • Parameters

          • certificate: Buffer
          • issuer: Buffer
          • callback: function
              • (err: Error | null, resp: Buffer): void
              • Parameters

                • err: Error | null
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "resumeSession"
    • listener: function
        • (sessionId: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • callback: function
              • (err: Error, sessionData: Buffer): void
              • Parameters

                • err: Error
                • sessionData: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "secureConnection"
    • listener: function

    Returns this

  • Parameters

    • event: "keylog"
    • listener: function
        • Parameters

          Returns void

    Returns this

prependListener

  • prependListener(event: string, listener: function): this
  • prependListener(event: "tlsClientError", listener: function): this
  • prependListener(event: "newSession", listener: function): this
  • prependListener(event: "OCSPRequest", listener: function): this
  • prependListener(event: "resumeSession", listener: function): this
  • prependListener(event: "secureConnection", listener: function): this
  • prependListener(event: "keylog", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "tlsClientError"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "newSession"
    • listener: function
        • (sessionId: Buffer, sessionData: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • sessionData: Buffer
          • callback: function
              • (err: Error, resp: Buffer): void
              • Parameters

                • err: Error
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "OCSPRequest"
    • listener: function
        • (certificate: Buffer, issuer: Buffer, callback: function): void
        • Parameters

          • certificate: Buffer
          • issuer: Buffer
          • callback: function
              • (err: Error | null, resp: Buffer): void
              • Parameters

                • err: Error | null
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "resumeSession"
    • listener: function
        • (sessionId: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • callback: function
              • (err: Error, sessionData: Buffer): void
              • Parameters

                • err: Error
                • sessionData: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "secureConnection"
    • listener: function

    Returns this

  • Parameters

    • event: "keylog"
    • listener: function
        • Parameters

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string, listener: function): this
  • prependOnceListener(event: "tlsClientError", listener: function): this
  • prependOnceListener(event: "newSession", listener: function): this
  • prependOnceListener(event: "OCSPRequest", listener: function): this
  • prependOnceListener(event: "resumeSession", listener: function): this
  • prependOnceListener(event: "secureConnection", listener: function): this
  • prependOnceListener(event: "keylog", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "tlsClientError"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "newSession"
    • listener: function
        • (sessionId: Buffer, sessionData: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • sessionData: Buffer
          • callback: function
              • (err: Error, resp: Buffer): void
              • Parameters

                • err: Error
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "OCSPRequest"
    • listener: function
        • (certificate: Buffer, issuer: Buffer, callback: function): void
        • Parameters

          • certificate: Buffer
          • issuer: Buffer
          • callback: function
              • (err: Error | null, resp: Buffer): void
              • Parameters

                • err: Error | null
                • resp: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "resumeSession"
    • listener: function
        • (sessionId: Buffer, callback: function): void
        • Parameters

          • sessionId: Buffer
          • callback: function
              • (err: Error, sessionData: Buffer): void
              • Parameters

                • err: Error
                • sessionData: Buffer

                Returns void

          Returns void

    Returns this

  • Parameters

    • event: "secureConnection"
    • listener: function

    Returns this

  • Parameters

    • event: "keylog"
    • listener: function
        • Parameters

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

ref

  • ref(): this
  • Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setTimeout

  • setTimeout(callback: function): this
  • setTimeout(msecs?: number, callback?: function): this
  • Parameters

    • callback: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • Optional msecs: number
    • Optional callback: function
        • (): void
        • Returns void

    Returns this

unref

  • unref(): this
  • Returns this

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc