diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-01-18 18:35:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-18 18:35:12 +0100 |
commit | 34b99fec8edcff7d3b667f273afea69df15e4d5e (patch) | |
tree | 108ea1800b83641023baede5bf9bceba8238f203 /cli/js/tls.ts | |
parent | 4f1fa82d1d0458170039d4809c3879993659e560 (diff) |
rename dial to connect and dialTLS to connectTLS (#3710)
Diffstat (limited to 'cli/js/tls.ts')
-rw-r--r-- | cli/js/tls.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/js/tls.ts b/cli/js/tls.ts index 1a2c4bdfd..4dfb32e31 100644 --- a/cli/js/tls.ts +++ b/cli/js/tls.ts @@ -5,19 +5,19 @@ import { Listener, Transport, Conn, ConnImpl, ListenerImpl } from "./net.ts"; // TODO(ry) There are many configuration options to add... // https://docs.rs/rustls/0.16.0/rustls/struct.ClientConfig.html -interface DialTLSOptions { +interface ConnectTLSOptions { port: number; hostname?: string; certFile?: string; } -const dialTLSDefaults = { hostname: "127.0.0.1", transport: "tcp" }; +const connectTLSDefaults = { hostname: "127.0.0.1", transport: "tcp" }; /** - * dialTLS establishes a secure connection over TLS (transport layer security). + * Establishes a secure connection over TLS (transport layer security). */ -export async function dialTLS(options: DialTLSOptions): Promise<Conn> { - options = Object.assign(dialTLSDefaults, options); - const res = await sendAsync(dispatch.OP_DIAL_TLS, options); +export async function connectTLS(options: ConnectTLSOptions): Promise<Conn> { + options = Object.assign(connectTLSDefaults, options); + const res = await sendAsync(dispatch.OP_CONNECT_TLS, options); return new ConnImpl(res.rid, res.remoteAddr!, res.localAddr!); } |