mirror of
https://github.com/Yonle/bostr.git
synced 2025-09-27 21:36:21 +02:00
http&bouncer: enable synchronousEvents & deflate compression by default.
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
@@ -284,7 +284,8 @@ function newConn(addr, id, reconn_t = 0) {
|
|||||||
headers: {
|
headers: {
|
||||||
"User-Agent": `Bostr (v${version}); The nostr relay bouncer; https://github.com/Yonle/bostr`
|
"User-Agent": `Bostr (v${version}); The nostr relay bouncer; https://github.com/Yonle/bostr`
|
||||||
},
|
},
|
||||||
noDelay: true
|
noDelay: true,
|
||||||
|
allowSynchronousEvents: true
|
||||||
});
|
});
|
||||||
|
|
||||||
relay.id = id;
|
relay.id = id;
|
||||||
|
@@ -23,6 +23,9 @@ module.exports = {
|
|||||||
// Log about bouncer connection with relays?
|
// Log about bouncer connection with relays?
|
||||||
log_about_relays: false,
|
log_about_relays: false,
|
||||||
|
|
||||||
|
// Use deflate compression for websocket.
|
||||||
|
perMessageDeflate: true,
|
||||||
|
|
||||||
// Time before reconnect to relays in milliseconds.
|
// Time before reconnect to relays in milliseconds.
|
||||||
reconnect_time: 5000,
|
reconnect_time: 5000,
|
||||||
|
|
||||||
|
6
http.js
6
http.js
@@ -37,7 +37,11 @@ if (
|
|||||||
server.isStandaloneHTTPS = false;
|
server.isStandaloneHTTPS = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wss = new WebSocket.WebSocketServer({ noServer: true });
|
const wss = new WebSocket.WebSocketServer({
|
||||||
|
noServer: true,
|
||||||
|
allowSynchronousEvents: true,
|
||||||
|
perMessageDeflate: config.perMessageDeflate || true
|
||||||
|
});
|
||||||
const lastConn = new Map();
|
const lastConn = new Map();
|
||||||
|
|
||||||
const favicon = fs.existsSync(config.favicon) ? fs.readFileSync(config.favicon) : null;
|
const favicon = fs.existsSync(config.favicon) ? fs.readFileSync(config.favicon) : null;
|
||||||
|
Reference in New Issue
Block a user