socket: use nodelay

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-01-04 13:36:14 +07:00
parent 70b9e9327a
commit 8b955f121f
2 changed files with 3 additions and 2 deletions

View File

@ -270,7 +270,8 @@ function newConn(addr, id) {
const relay = new WebSocket(addr, {
headers: {
"User-Agent": "Bostr; The nostr relay bouncer; https://github.com/Yonle/bostr"
}
},
noDelay: true
});
relay.id = id;

View File

@ -9,7 +9,7 @@ const curD = _ => (new Date()).toLocaleString("ia");
const log = _ => console.log(process.pid, curD(), "-", _);
// Server
const server = http.createServer()
const server = http.createServer({ noDelay: true })
const wss = new WebSocket.WebSocketServer({ noServer: true });
server.on('request', (req, res) => {