mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-18 05:42:03 +01:00
connections: try not use noDelay & allowSynchronousEvents
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
8fc6c71d8e
commit
6bf93d5be6
6
http.js
6
http.js
@ -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;
|
||||
|
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user