summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std/ws/README.md4
-rw-r--r--std/ws/example_client.ts2
-rw-r--r--std/ws/example_server.ts2
3 files changed, 4 insertions, 4 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)"));
diff --git a/std/ws/example_client.ts b/std/ws/example_client.ts
index 53b1a4ed5..664073210 100644
--- a/std/ws/example_client.ts
+++ b/std/ws/example_client.ts
@@ -9,7 +9,7 @@ import { BufReader } from "../io/bufio.ts";
import { TextProtoReader } from "../textproto/mod.ts";
import { blue, green, red, yellow } from "../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)"));
diff --git a/std/ws/example_server.ts b/std/ws/example_server.ts
index 982f72412..03adc0a49 100644
--- a/std/ws/example_server.ts
+++ b/std/ws/example_server.ts
@@ -8,7 +8,7 @@ import {
} from "./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;