From d1c79acd728555e18a9575e24bee29bff78e42eb Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 4 Jul 2023 00:52:35 -0400 Subject: [PATCH] fix: fastify needs register to be awaited, connection binaryType set to nodebuffer after hyper setup, and no http2 --- src/modules/relay.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/relay.ts b/src/modules/relay.ts index 6990852..4b04bca 100644 --- a/src/modules/relay.ts +++ b/src/modules/relay.ts @@ -19,14 +19,14 @@ export async function start() { const dht = getSwarm(); let relayServer = fastify({ - http2: true, logger: log.child({ module: "relay-server" }), }); - relayServer.register(websocket); + await relayServer.register(websocket); relayServer.get("/", { websocket: true }, (connection) => { relay(dht, new Stream(false, connection.socket)); + connection.socket.binaryType = "nodebuffer"; }); let port = config.uint("core.relayPort");