Server.prototype.on - Node documentation
method Server.prototype.on

Usage in Deno

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

Parameters

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

Return Type

this
Server.prototype.on(
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.on(
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.on(
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.on(
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.on(
event: "secureConnection",
listener: (tlsSocket: tls.TLSSocket) => void,
): this

Parameters

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

Return Type

this
Server.prototype.on(
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.on(
event: "close",
listener: () => void,
): this

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this
Server.prototype.on(
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.on(
event: "request",
listener: http.RequestListener<Request, Response>,
): this

Parameters

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

Return Type

this
Server.prototype.on(
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