diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-09-20 18:32:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-20 18:32:18 -0400 |
commit | 97bb2bdb79cbd0a400c643e7be0029440cb15633 (patch) | |
tree | 92c883d38b7af413fcbfbac82f17775a7064dfec /cli/tests/echo_server.ts | |
parent | 93b7acf99d6456e6e194c03f024b788ce5adf20e (diff) |
dial/listen API change (#3000)
Previously: dial("tcp", "deno.land:80")
Now: dial({ hostname: "deno.land", port: 80, transport: "tcp" })
Similarly with listen().
Diffstat (limited to 'cli/tests/echo_server.ts')
-rw-r--r-- | cli/tests/echo_server.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/tests/echo_server.ts b/cli/tests/echo_server.ts index 73995eab5..82ee1fdab 100644 --- a/cli/tests/echo_server.ts +++ b/cli/tests/echo_server.ts @@ -1,6 +1,7 @@ const { args, listen, copy } = Deno; const addr = args[1] || "127.0.0.1:4544"; -const listener = listen("tcp", addr); +const [hostname, port] = addr.split(":"); +const listener = listen({ hostname, port: Number(port) }); console.log("listening on", addr); listener.accept().then( async (conn): Promise<void> => { |