From 7a793cf2c6eac2386a39a9d424b60c949818a26f Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Wed, 10 Jun 2020 00:41:11 -0400 Subject: [PATCH] Adapt to whatever host serves the client --- package.json | 3 ++- src/index.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 937fceb..d8dbf3a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "build": "parcel build src/index.html", "clean": "rimraf .cache dist", "live": "parcel src/index.html", - "tsc:check": "tsc --noEmit" + "watch": "parcel watch src/index.html", + "check": "tsc --noEmit" }, "author": "Tangent 128", "license": "ISC", diff --git a/src/index.ts b/src/index.ts index 7675f96..3c4dfad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,7 @@ import {} from "./net/LoopbackServer"; */ Select(".GameCanvas").forEachCanvas((c, cx, keys) => { - const connection = new Connection("ws://localhost:9090/base2020.ws"); + const connection = new Connection(`ws://${location.host}/base2020.ws`); new Main(c, cx, keys, connection.socket); c.focus(); });