interface FastifyListenOptions {
    backlog?: number;
    exclusive?: boolean;
    host?: string;
    ipv6Only?: boolean;
    listenTextResolver?: ((address) => string);
    path?: string;
    port?: number;
    readableAll?: boolean;
    signal?: AbortSignal;
    writableAll?: boolean;
}

Properties

backlog?: number

Specify the maximum length of the queue of pending connections. The actual length will be determined by the OS through sysctl settings such as tcp_max_syn_backlog and somaxconn on Linux. Default to 511.

exclusive?: boolean

Default to false.

host?: string

Default to localhost.

ipv6Only?: boolean

For TCP servers, setting ipv6Only to true will disable dual-stack support, i.e., binding to host :: won't make 0.0.0.0 be bound. Default to false.

listenTextResolver?: ((address) => string)

Function that resolves text to log after server has been successfully started

Type declaration

    • (address): string
    • Parameters

      • address: string

      Returns string

path?: string

Will be ignored if port is specified.

port?: number

Default to 0 (picks the first available open port).

readableAll?: boolean

For IPC servers makes the pipe readable for all users. Default to false.

signal?: AbortSignal

An AbortSignal that may be used to close a listening server.

Since

This option is available only in Node.js v15.6.0 and greater

writableAll?: boolean

For IPC servers makes the pipe writable for all users. Default to false.