connections: try not use noDelay & allowSynchronousEvents

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-05-11 10:30:08 +07:00
parent 8fc6c71d8e
commit 6bf93d5be6
2 changed files with 3 additions and 7 deletions

View File

@ -27,7 +27,6 @@ if (
allowHTTP1: true,
key: fs.readFileSync(config.https?.privKey),
cert: fs.readFileSync(config.https?.certificate),
noDelay: true,
dhparam: "auto",
paddingStrategy: http2.constants.PADDING_STRATEGY_MAX
}
@ -38,14 +37,13 @@ if (
server = http2.createSecureServer(http2_options);
server.isStandaloneHTTPS = true;
} else {
server = http.createServer({ noDelay: true })
server = http.createServer()
server.isStandaloneHTTPS = false;
}
const wss = new WebSocket.WebSocketServer({
noServer: true,
allowSynchronousEvents: true,
perMessageDeflate: config.perMessageDeflate || true
perMessageDeflate: config.perMessageDeflate || false
});
const favicon = fs.existsSync(config.favicon) ? fs.readFileSync(config.favicon) : null;

View File

@ -282,9 +282,7 @@ function newConn(addr, id, reconn_t = 0) {
const relay = new WebSocket(addr, {
headers: {
"User-Agent": `Bostr ${version}; The nostr relay bouncer; https://github.com/Yonle/bostr`,
},
noDelay: true,
allowSynchronousEvents: true
}
});
relay.isCache = relay_type(addr) === "cache_relay";