Adapt to whatever host serves the client

This commit is contained in:
Tangent Wantwight 2020-06-10 00:41:11 -04:00
parent a499cb2064
commit 7a793cf2c6
2 changed files with 3 additions and 2 deletions

View file

@ -7,7 +7,8 @@
"build": "parcel build src/index.html", "build": "parcel build src/index.html",
"clean": "rimraf .cache dist", "clean": "rimraf .cache dist",
"live": "parcel src/index.html", "live": "parcel src/index.html",
"tsc:check": "tsc --noEmit" "watch": "parcel watch src/index.html",
"check": "tsc --noEmit"
}, },
"author": "Tangent 128", "author": "Tangent 128",
"license": "ISC", "license": "ISC",

View file

@ -18,7 +18,7 @@ import {} from "./net/LoopbackServer";
*/ */
Select(".GameCanvas").forEachCanvas((c, cx, keys) => { Select(".GameCanvas").forEachCanvas((c, cx, keys) => {
const connection = new Connection<KeyName[], Data>("ws://localhost:9090/base2020.ws"); const connection = new Connection<KeyName[], Data>(`ws://${location.host}/base2020.ws`);
new Main(c, cx, keys, connection.socket); new Main(c, cx, keys, connection.socket);
c.focus(); c.focus();
}); });