fix: fastify needs register to be awaited, connection binaryType set to nodebuffer after hyper setup, and no http2
This commit is contained in:
parent
7e17b477bd
commit
d1c79acd72
|
@ -19,14 +19,14 @@ export async function start() {
|
||||||
const dht = getSwarm();
|
const dht = getSwarm();
|
||||||
|
|
||||||
let relayServer = fastify({
|
let relayServer = fastify({
|
||||||
http2: true,
|
|
||||||
logger: log.child({ module: "relay-server" }),
|
logger: log.child({ module: "relay-server" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
relayServer.register(websocket);
|
await relayServer.register(websocket);
|
||||||
|
|
||||||
relayServer.get("/", { websocket: true }, (connection) => {
|
relayServer.get("/", { websocket: true }, (connection) => {
|
||||||
relay(dht, new Stream(false, connection.socket));
|
relay(dht, new Stream(false, connection.socket));
|
||||||
|
connection.socket.binaryType = "nodebuffer";
|
||||||
});
|
});
|
||||||
|
|
||||||
let port = config.uint("core.relayPort");
|
let port = config.uint("core.relayPort");
|
||||||
|
|
Loading…
Reference in New Issue