-
Linux CentOS8, 4.18.0 "use strict";
const uWS = require('uWebSockets.js');
const backpressure = 0;
let w;
uWS.App({}).ws('/*', {
compression: uWS.SHARED_COMPRESSOR,
maxPayloadLength: 0, // doesn't really matter, tested with 0 and 1024 * 1024 * 16
idleTimeout: 3200,
open: (ws) => {
console.log("got new websocket");
},
message: (a, b, c) {},
drain: (a) {},
close: (ws, code, message) => {
console.log('WebSocket closed');
console.log(code, message);
}
}).any("/*", function(res, req) {
res.end("Nothing to see here.");
}).listen(8080, (token) => {
if (token) {
console.log('Listening to port ' + 8080);
} else {
console.log('Failed to listen to port ' + 8080);
}
}); After connecting with a socket and waiting exactly 1 minute, no matter what idleTimeout is set to (tested 3200 and 0 multiple times, whilst also trying to change maxPayloadLength in case the socket is trying to send something under the hood like ACK or something? whatever, just trying to check everything before posting an issue here). I wonder why that is. Maybe I'm doing something wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Maybe closing connection by timeout in proxy server (Nginx, HAProxy, etc...) |
Beta Was this translation helpful? Give feedback.
-
Oopsie. Turns out to be Nginx. Did not know it has idle timeout too. Sorry for trouble. |
Beta Was this translation helpful? Give feedback.
Oopsie. Turns out to be Nginx. Did not know it has idle timeout too. Sorry for trouble.