fix: need to pass the dht property to dht-relay

This commit is contained in:
Derrick Hammer 2023-07-06 13:25:33 -04:00
parent d1c79acd72
commit 7cb443f62b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -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";
});