endpointOptions.reusePort
- 类型:<boolean>
- 默认:
false
当 true 时,允许多个端点(在不同进程中)绑定到相同的地址和端口。内核将会在所有使用此选项绑定的套接字之间对传入的 UDP 数据报进行负载均衡。这使得通过在同一端口上运行多个 Node.js 进程来实现 QUIC 服务器的水平扩展成为可能。
🌐 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.
支持 Linux 3.9 及以上版本和 DragonFlyBSD 3.6 及以上版本。在不支持的平台上,绑定将失败并显示错误。
🌐 Supported on Linux 3.9+ and DragonFlyBSD 3.6+. On unsupported platforms, the bind will fail with an error.