diff options
author | Clemens Tolboom <clemens@build2be.com> | 2020-02-20 16:19:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 10:19:14 -0500 |
commit | 7e49d96cbcde1e8eb89d0fdd499be473822b725b (patch) | |
tree | 0e1a42625137492a05d1bdbab5fa3d445a76fa18 /std/ws/README.md | |
parent | 6431622a6debc0443f9269fe0157571ec54701c0 (diff) |
/std/ws: Fix args index for WS examples (#4046)
Diffstat (limited to 'std/ws/README.md')
-rw-r--r-- | std/ws/README.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/std/ws/README.md b/std/ws/README.md index c3b3fe2c6..a8101f9f0 100644 --- a/std/ws/README.md +++ b/std/ws/README.md @@ -16,7 +16,7 @@ import { } from "https://deno.land/std/ws/mod.ts"; /** websocket echo server */ -const port = Deno.args[1] || "8080"; +const port = Deno.args[0] || "8080"; console.log(`websocket server is running on :${port}`); for await (const req of serve(`:${port}`)) { const { headers, conn } = req; @@ -80,7 +80,7 @@ import { BufReader } from "https://deno.land/std/io/bufio.ts"; import { TextProtoReader } from "https://deno.land/std/textproto/mod.ts"; import { blue, green, red, yellow } from "https://deno.land/std/fmt/colors.ts"; -const endpoint = Deno.args[1] || "ws://127.0.0.1:8080"; +const endpoint = Deno.args[0] || "ws://127.0.0.1:8080"; /** simple websocket cli */ const sock = await connectWebSocket(endpoint); console.log(green("ws connected! (type 'close' to quit)")); |