Skip to main content
Server.prototype.once - https - Node documentation
method Server.prototype.once

Usage in Deno

import { Server } from "node:https";
Server.prototype.once(
event: string,
listener: (...args: any[]) => void,
): this

Parameters

event: string
listener: (...args: any[]) => void

Return Type

this
Server.prototype.once(
event: "keylog",
listener: (
line: Buffer,
tlsSocket: tls.TLSSocket,
) => void
,
): this

Parameters

event: "keylog"
listener: (
line: Buffer,
tlsSocket: tls.TLSSocket,
) => void

Return Type

this
Server.prototype.once(
event: "newSession",
listener: (
sessionId: Buffer,
sessionData: Buffer,
callback: (
err: Error,
resp: Buffer,
) => void
,
) => void
,
): this

Parameters

event: "newSession"
listener: (
sessionId: Buffer,
sessionData: Buffer,
callback: (
err: Error,
resp: Buffer,
) => void
,
) => void

Return Type

this
Server.prototype.once(
event: "OCSPRequest",
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (
err: Error | null,
resp: Buffer,
) => void
,
) => void
,
): this

Parameters

event: "OCSPRequest"
listener: (
certificate: Buffer,
issuer: Buffer,
callback: (
err: Error | null,
resp: Buffer,
) => void
,
) => void

Return Type

this
Server.prototype.once(
event: "resumeSession",
listener: (
sessionId: Buffer,
callback: (
err: Error,
sessionData: Buffer,
) => void
,
) => void
,
): this

Parameters

event: "resumeSession"
listener: (
sessionId: Buffer,
callback: (
err: Error,
sessionData: Buffer,
) => void
,
) => void

Return Type

this
Server.prototype.once(
event: "secureConnection",
listener: (tlsSocket: tls.TLSSocket) => void,
): this

Parameters

event: "secureConnection"
listener: (tlsSocket: tls.TLSSocket) => void

Return Type

this
Server.prototype.once(
event: "tlsClientError",
listener: (
err: Error,
tlsSocket: tls.TLSSocket,
) => void
,
): this

Parameters

event: "tlsClientError"
listener: (
err: Error,
tlsSocket: tls.TLSSocket,
) => void

Return Type

this
Server.prototype.once(
event: "close",
listener: () => void,
): this

Parameters

event: "close"
listener: () => void

Return Type

this
Server.prototype.once(
event: "connection",
listener: (socket: Duplex) => void,
): this

Parameters

event: "connection"
listener: (socket: Duplex) => void

Return Type

this
Server.prototype.once(
event: "error",
listener: (err: Error) => void,
): this

Parameters

event: "error"
listener: (err: Error) => void

Return Type

this
Server.prototype.once(
event: "listening",
listener: () => void,
): this

Parameters

event: "listening"
listener: () => void

Return Type

this
Server.prototype.once(
event: "checkContinue",
listener: http.RequestListener<Request, Response>,
): this

Parameters

event: "checkContinue"
listener: http.RequestListener<Request, Response>

Return Type

this
Server.prototype.once(
event: "checkExpectation",
listener: http.RequestListener<Request, Response>,
): this

Parameters

event: "checkExpectation"
listener: http.RequestListener<Request, Response>

Return Type

this
Server.prototype.once(
event: "clientError",
listener: (
err: Error,
socket: Duplex,
) => void
,
): this

Parameters

event: "clientError"
listener: (
err: Error,
socket: Duplex,
) => void

Return Type

this
Server.prototype.once(
event: "connect",
listener: (
req: InstanceType<Request>,
socket: Duplex,
head: Buffer,
) => void
,
): this

Parameters

event: "connect"
listener: (
req: InstanceType<Request>,
socket: Duplex,
head: Buffer,
) => void

Return Type

this
Server.prototype.once(
event: "request",
listener: http.RequestListener<Request, Response>,
): this

Parameters

event: "request"
listener: http.RequestListener<Request, Response>

Return Type

this
Server.prototype.once(
event: "upgrade",
listener: (
req: InstanceType<Request>,
socket: Duplex,
head: Buffer,
) => void
,
): this

Parameters

event: "upgrade"
listener: (
req: InstanceType<Request>,
socket: Duplex,
head: Buffer,
) => void

Return Type

this