class Server
extends tls.Server
Usage in Deno
import { Server } from "node:https";
<div class="alert alert-warning"><div><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 9v4" />
<path
d="M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z" />
<path d="M12 16h.01" />
</svg>
Deno compatibility</div><div><p>
The <code>cert</code> and <code>key</code> options do not support an array input.</p>
</div></div>
See http.Server
for more information.
addListener(event: string,listener: (...args: any[]) => void,): this
addListener(event: "keylog",listener: (line: Buffer,tlsSocket: tls.TLSSocket,) => void,): this
addListener(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: (err: Error,resp: Buffer,) => void,) => void,): this
addListener(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): this
addListener(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error,sessionData: Buffer,) => void,) => void,): this
addListener(event: "secureConnection",listener: (tlsSocket: tls.TLSSocket) => void,): this
addListener(event: "tlsClientError",listener: (err: Error,tlsSocket: tls.TLSSocket,) => void,): this
addListener(event: "close",listener: () => void,): this
addListener(event: "connection",listener: (socket: Duplex) => void,): this
addListener(event: "error",listener: (err: Error) => void,): this
addListener(event: "listening",listener: () => void,): this
addListener(): this
addListener(): this
addListener(event: "clientError",listener: (err: Error,socket: Duplex,) => void,): this
addListener(): this
addListener(): this
addListener(): this
closeAllConnections(): void
Closes all connections connected to this server.
closeIdleConnections(): void
Closes all connections connected to this server which are not sending a request or waiting for a response.
emit(event: string,...args: any[],): boolean
emit(event: "keylog",line: Buffer,tlsSocket: tls.TLSSocket,): boolean
emit(event: "newSession",sessionId: Buffer,sessionData: Buffer,callback: (err: Error,resp: Buffer,) => void,): boolean
emit(event: "OCSPRequest",certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,): boolean
emit(event: "resumeSession",sessionId: Buffer,callback: (err: Error,sessionData: Buffer,) => void,): boolean
emit(event: "secureConnection",tlsSocket: tls.TLSSocket,): boolean
emit(event: "tlsClientError",err: Error,tlsSocket: tls.TLSSocket,): boolean
emit(event: "close"): boolean
emit(event: "error",err: Error,): boolean
emit(event: "listening"): boolean
on(event: string,listener: (...args: any[]) => void,): this
on(event: "keylog",listener: (line: Buffer,tlsSocket: tls.TLSSocket,) => void,): this
on(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: (err: Error,resp: Buffer,) => void,) => void,): this
on(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): this
on(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error,sessionData: Buffer,) => void,) => void,): this
on(event: "secureConnection",listener: (tlsSocket: tls.TLSSocket) => void,): this
on(event: "tlsClientError",listener: (err: Error,tlsSocket: tls.TLSSocket,) => void,): this
on(event: "close",listener: () => void,): this
on(event: "error",listener: (err: Error) => void,): this
on(event: "listening",listener: () => void,): this
once(event: string,listener: (...args: any[]) => void,): this
once(event: "keylog",listener: (line: Buffer,tlsSocket: tls.TLSSocket,) => void,): this
once(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: (err: Error,resp: Buffer,) => void,) => void,): this
once(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): this
once(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error,sessionData: Buffer,) => void,) => void,): this
once(event: "secureConnection",listener: (tlsSocket: tls.TLSSocket) => void,): this
once(event: "tlsClientError",listener: (err: Error,tlsSocket: tls.TLSSocket,) => void,): this
once(event: "close",listener: () => void,): this
once(event: "error",listener: (err: Error) => void,): this
once(event: "listening",listener: () => void,): this
prependListener(event: string,listener: (...args: any[]) => void,): this
prependListener(event: "keylog",listener: (line: Buffer,tlsSocket: tls.TLSSocket,) => void,): this
prependListener(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: (err: Error,resp: Buffer,) => void,) => void,): this
prependListener(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): this
prependListener(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error,sessionData: Buffer,) => void,) => void,): this
prependListener(event: "secureConnection",listener: (tlsSocket: tls.TLSSocket) => void,): this
prependListener(event: "tlsClientError",listener: (err: Error,tlsSocket: tls.TLSSocket,) => void,): this
prependListener(event: "close",listener: () => void,): this
prependListener(event: "connection",listener: (socket: Duplex) => void,): this
prependListener(event: "error",listener: (err: Error) => void,): this
prependListener(event: "listening",listener: () => void,): this
prependListener(): this
prependListener(): this
prependListener(event: "clientError",listener: (err: Error,socket: Duplex,) => void,): this
prependListener(): this
prependListener(): this
prependListener(): this
prependOnceListener(event: string,listener: (...args: any[]) => void,): this
prependOnceListener(event: "keylog",listener: (line: Buffer,tlsSocket: tls.TLSSocket,) => void,): this
prependOnceListener(event: "newSession",listener: (sessionId: Buffer,sessionData: Buffer,callback: (err: Error,resp: Buffer,) => void,) => void,): this
prependOnceListener(event: "OCSPRequest",listener: (certificate: Buffer,issuer: Buffer,callback: (err: Error | null,resp: Buffer,) => void,) => void,): this
prependOnceListener(event: "resumeSession",listener: (sessionId: Buffer,callback: (err: Error,sessionData: Buffer,) => void,) => void,): this
prependOnceListener(event: "secureConnection",listener: (tlsSocket: tls.TLSSocket) => void,): this
prependOnceListener(event: "tlsClientError",listener: (err: Error,tlsSocket: tls.TLSSocket,) => void,): this
prependOnceListener(event: "close",listener: () => void,): this
prependOnceListener(event: "connection",listener: (socket: Duplex) => void,): this
prependOnceListener(event: "error",listener: (err: Error) => void,): this
prependOnceListener(event: "listening",listener: () => void,): this
prependOnceListener(): this
prependOnceListener(): this
prependOnceListener(event: "clientError",listener: (err: Error,socket: Duplex,) => void,): this
prependOnceListener(): this
prependOnceListener(): this
prependOnceListener(): this