mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
feat: Deno.listenTLS (#3152)
This commit is contained in:
parent
1f52c66ced
commit
6c5a981fd2
16 changed files with 646 additions and 22 deletions
24
cli/js/lib.deno_runtime.d.ts
vendored
24
cli/js/lib.deno_runtime.d.ts
vendored
|
@ -990,6 +990,29 @@ declare namespace Deno {
|
|||
*/
|
||||
export function listen(options: ListenOptions): Listener;
|
||||
|
||||
export interface ListenTLSOptions {
|
||||
port: number;
|
||||
hostname?: string;
|
||||
transport?: Transport;
|
||||
certFile: string;
|
||||
keyFile: string;
|
||||
}
|
||||
|
||||
/** Listen announces on the local transport address over TLS (transport layer security).
|
||||
*
|
||||
* @param options
|
||||
* @param options.port The port to connect to. (Required.)
|
||||
* @param options.hostname A literal IP address or host name that can be
|
||||
* resolved to an IP address. If not specified, defaults to 0.0.0.0
|
||||
* @param options.certFile Server certificate file
|
||||
* @param options.keyFile Server public key file
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* Deno.listenTLS({ port: 443, certFile: "./my_server.crt", keyFile: "./my_server.key" })
|
||||
*/
|
||||
export function listenTLS(options: ListenTLSOptions): Listener;
|
||||
|
||||
export interface DialOptions {
|
||||
port: number;
|
||||
hostname?: string;
|
||||
|
@ -1018,6 +1041,7 @@ declare namespace Deno {
|
|||
export interface DialTLSOptions {
|
||||
port: number;
|
||||
hostname?: string;
|
||||
certFile?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue