From 7cb443f62b30d3214fd5f806b6b2c35525b12301 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 6 Jul 2023 13:25:33 -0400 Subject: [PATCH] fix: need to pass the dht property to dht-relay --- 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 4b04bca..4226e1d 100644 --- a/src/modules/relay.ts +++ b/src/modules/relay.ts @@ -16,7 +16,7 @@ import * as http2 from "http2"; import websocket from "@fastify/websocket"; export async function start() { - const dht = getSwarm(); + const swarm = getSwarm(); let relayServer = fastify({ logger: log.child({ module: "relay-server" }), @@ -25,7 +25,7 @@ export async function start() { await relayServer.register(websocket); relayServer.get("/", { websocket: true }, (connection) => { - relay(dht, new Stream(false, connection.socket)); + relay(swarm.dht, new Stream(false, connection.socket)); connection.socket.binaryType = "nodebuffer"; });