From 409460f2ce5c83d5df909b6f847fe9eea2fb7105 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 15 May 2026 19:46:56 -0700 Subject: [PATCH] quic: add reusePort option to QuicEndpoint Signed-off-by: James M Snell Assisted-by: Opencode:Opus 4.6 PR-URL: https://github.com/nodejs/node/pull/63267 Reviewed-By: Matteo Collina --- doc/api/quic.md | 17 +++++++++++++++++ lib/internal/quic/quic.js | 3 +++ src/quic/bindingdata.h | 1 + src/quic/endpoint.cc | 4 +++- src/quic/endpoint.h | 6 ++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index 84020595d78..277a0b80c2c 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -2286,6 +2286,23 @@ added: v23.8.0 When `true`, indicates that the endpoint should bind only to IPv6 addresses. +#### `endpointOptions.reusePort` + + + +* Type: {boolean} +* Default: `false` + +When `true`, allows multiple endpoints (across separate processes) to bind to +the same address and port. The kernel will load-balance incoming UDP datagrams +across all sockets bound with this option. This enables horizontal scaling of +QUIC servers by running multiple Node.js processes on the same port. + +Supported on Linux 3.9+ and DragonFlyBSD 3.6+. On unsupported platforms, the +bind will fail with an error. + #### `endpointOptions.maxConnectionsPerHost`