summaryrefslogtreecommitdiff
path: root/cli/js/tls.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/tls.ts')
-rw-r--r--cli/js/tls.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/js/tls.ts b/cli/js/tls.ts
index b8815831b..2780956a1 100644
--- a/cli/js/tls.ts
+++ b/cli/js/tls.ts
@@ -1,6 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { sendAsync, sendSync } from "./dispatch_json.ts";
-import * as dispatch from "./dispatch.ts";
import { Listener, Transport, Conn, ConnImpl, ListenerImpl } from "./net.ts";
// TODO(ry) There are many configuration options to add...
@@ -18,13 +17,13 @@ const connectTLSDefaults = { hostname: "127.0.0.1", transport: "tcp" };
*/
export async function connectTLS(options: ConnectTLSOptions): Promise<Conn> {
options = Object.assign(connectTLSDefaults, options);
- const res = await sendAsync(dispatch.OP_CONNECT_TLS, options);
+ const res = await sendAsync("op_connect_tls", options);
return new ConnImpl(res.rid, res.remoteAddr!, res.localAddr!);
}
class TLSListenerImpl extends ListenerImpl {
async accept(): Promise<Conn> {
- const res = await sendAsync(dispatch.OP_ACCEPT_TLS, { rid: this.rid });
+ const res = await sendAsync("op_accept_tls", { rid: this.rid });
return new ConnImpl(res.rid, res.remoteAddr, res.localAddr);
}
}
@@ -53,7 +52,7 @@ export interface ListenTLSOptions {
export function listenTLS(options: ListenTLSOptions): Listener {
const hostname = options.hostname || "0.0.0.0";
const transport = options.transport || "tcp";
- const res = sendSync(dispatch.OP_LISTEN_TLS, {
+ const res = sendSync("op_listen_tls", {
hostname,
port: options.port,
transport,