Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Server

Hierarchy

Index

Constructors

constructor

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

addListener

  • addListener(event: string, listener: function): this
  • addListener(event: "close", listener: function): this
  • addListener(event: "connection", listener: function): this
  • addListener(event: "error", listener: function): this
  • addListener(event: "listening", listener: function): this
  • events.EventEmitter

    1. close
    2. connection
    3. error
    4. listening

    Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • 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: "close"): boolean
  • emit(event: "connection", socket: Socket): boolean
  • emit(event: "error", err: Error): boolean
  • emit(event: "listening"): boolean
  • Parameters

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

    Returns boolean

  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "connection"
    • socket: Socket

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: "listening"

    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: "close", listener: function): this
  • on(event: "connection", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "listening", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

once

  • once(event: string, listener: function): this
  • once(event: "close", listener: function): this
  • once(event: "connection", listener: function): this
  • once(event: "error", listener: function): this
  • once(event: "listening", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

prependListener

  • prependListener(event: string, listener: function): this
  • prependListener(event: "close", listener: function): this
  • prependListener(event: "connection", listener: function): this
  • prependListener(event: "error", listener: function): this
  • prependListener(event: "listening", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string, listener: function): this
  • prependOnceListener(event: "close", listener: function): this
  • prependOnceListener(event: "connection", listener: function): this
  • prependOnceListener(event: "error", listener: function): this
  • prependOnceListener(event: "listening", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • 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(msecs?: number, callback?: function): this
  • setTimeout(callback: function): this
  • Parameters

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

    Returns this

  • Parameters

    • 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