fix: disable server timeouts and force IPv4 DNS resolution to resolve connection stability issues
Browse files- health-server.js +2 -0
- start.sh +3 -0
health-server.js
CHANGED
|
@@ -662,6 +662,8 @@ server.on("upgrade", (req, socket, head) => {
|
|
| 662 |
proxySocket.on("error", () => socket.destroy());
|
| 663 |
});
|
| 664 |
|
|
|
|
|
|
|
| 665 |
server.listen(PORT, "0.0.0.0", () =>
|
| 666 |
console.log(`Namespace Proxy on ${PORT} -> n8n on ${TARGET_PORT}`),
|
| 667 |
);
|
|
|
|
| 662 |
proxySocket.on("error", () => socket.destroy());
|
| 663 |
});
|
| 664 |
|
| 665 |
+
server.timeout = 0;
|
| 666 |
+
server.keepAliveTimeout = 0;
|
| 667 |
server.listen(PORT, "0.0.0.0", () =>
|
| 668 |
console.log(`Namespace Proxy on ${PORT} -> n8n on ${TARGET_PORT}`),
|
| 669 |
);
|
start.sh
CHANGED
|
@@ -35,6 +35,9 @@ export N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS="${N8N_ENFORCE_SETTINGS_FILE_PERMIS
|
|
| 35 |
export GENERIC_TIMEZONE="${GENERIC_TIMEZONE:-${TZ:-UTC}}"
|
| 36 |
export TZ="${TZ:-$GENERIC_TIMEZONE}"
|
| 37 |
|
|
|
|
|
|
|
|
|
|
| 38 |
# Disable noisy or unnecessary services
|
| 39 |
export N8N_PYTHON_NODES_ENABLED="${N8N_PYTHON_NODES_ENABLED:-false}"
|
| 40 |
export N8N_TASK_RUNNERS_ENABLED="${N8N_TASK_RUNNERS_ENABLED:-false}"
|
|
|
|
| 35 |
export GENERIC_TIMEZONE="${GENERIC_TIMEZONE:-${TZ:-UTC}}"
|
| 36 |
export TZ="${TZ:-$GENERIC_TIMEZONE}"
|
| 37 |
|
| 38 |
+
# Force IPv4 resolution to prevent Node.js IPv6 timeouts (Fixes "Client network socket disconnected" for Discord/outbound requests)
|
| 39 |
+
export NODE_OPTIONS="--dns-result-order=ipv4first"
|
| 40 |
+
|
| 41 |
# Disable noisy or unnecessary services
|
| 42 |
export N8N_PYTHON_NODES_ENABLED="${N8N_PYTHON_NODES_ENABLED:-false}"
|
| 43 |
export N8N_TASK_RUNNERS_ENABLED="${N8N_TASK_RUNNERS_ENABLED:-false}"
|