mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 06:10:01 -04:00
allow tracker to reject outdated servers
This commit is contained in:
parent
55dece7bc3
commit
c6f06d9724
5 changed files with 19 additions and 9 deletions
|
@ -6,6 +6,7 @@ import { AdriftServer, connectTracker } from "./server";
|
|||
|
||||
import WebSocket from "isomorphic-ws";
|
||||
import { answerRtc, bufferToArrayBuffer } from "./rtc";
|
||||
import { PROTOCOL_VERSION } from "protocol";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
|
@ -50,9 +51,9 @@ app.ws("/dev-ws", (ws, _req) => {
|
|||
});
|
||||
|
||||
try {
|
||||
let tracker = new WebSocket("ws://localhost:17776/join");
|
||||
let tracker = new WebSocket(`ws://localhost:17776/join?protocol=${PROTOCOL_VERSION}`);
|
||||
tracker.onerror = console.error;
|
||||
connectTracker(tracker);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
app.listen(3000, () => console.log("listening"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue