mirror of
https://github.com/Yonle/bostr.git
synced 2025-09-20 06:30:37 +02:00
connections: try not use noDelay & allowSynchronousEvents
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
6
http.js
6
http.js
@@ -27,7 +27,6 @@ if (
|
|||||||
allowHTTP1: true,
|
allowHTTP1: true,
|
||||||
key: fs.readFileSync(config.https?.privKey),
|
key: fs.readFileSync(config.https?.privKey),
|
||||||
cert: fs.readFileSync(config.https?.certificate),
|
cert: fs.readFileSync(config.https?.certificate),
|
||||||
noDelay: true,
|
|
||||||
dhparam: "auto",
|
dhparam: "auto",
|
||||||
paddingStrategy: http2.constants.PADDING_STRATEGY_MAX
|
paddingStrategy: http2.constants.PADDING_STRATEGY_MAX
|
||||||
}
|
}
|
||||||
@@ -38,14 +37,13 @@ if (
|
|||||||
server = http2.createSecureServer(http2_options);
|
server = http2.createSecureServer(http2_options);
|
||||||
server.isStandaloneHTTPS = true;
|
server.isStandaloneHTTPS = true;
|
||||||
} else {
|
} else {
|
||||||
server = http.createServer({ noDelay: true })
|
server = http.createServer()
|
||||||
server.isStandaloneHTTPS = false;
|
server.isStandaloneHTTPS = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wss = new WebSocket.WebSocketServer({
|
const wss = new WebSocket.WebSocketServer({
|
||||||
noServer: true,
|
noServer: true,
|
||||||
allowSynchronousEvents: true,
|
perMessageDeflate: config.perMessageDeflate || false
|
||||||
perMessageDeflate: config.perMessageDeflate || true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const favicon = fs.existsSync(config.favicon) ? fs.readFileSync(config.favicon) : null;
|
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, {
|
const relay = new WebSocket(addr, {
|
||||||
headers: {
|
headers: {
|
||||||
"User-Agent": `Bostr ${version}; The nostr relay bouncer; https://github.com/Yonle/bostr`,
|
"User-Agent": `Bostr ${version}; The nostr relay bouncer; https://github.com/Yonle/bostr`,
|
||||||
},
|
}
|
||||||
noDelay: true,
|
|
||||||
allowSynchronousEvents: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
relay.isCache = relay_type(addr) === "cache_relay";
|
relay.isCache = relay_type(addr) === "cache_relay";
|
||||||
|
Reference in New Issue
Block a user