From b6bde18d3f3f102bce86048dcecd04d864bb9b2b Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 24 May 2026 07:19:35 -0700 Subject: [PATCH] quic: add listEndpoints API Signed-off-by: James M Snell --- doc/api/quic.md | 15 +++ lib/internal/quic/quic.js | 20 ++++ lib/quic.js | 58 +++++------- test/parallel/test-quic-exports.mjs | 6 -- test/parallel/test-quic-list-endpoints.mjs | 105 +++++++++++++++++++++ 5 files changed, 161 insertions(+), 43 deletions(-) create mode 100644 test/parallel/test-quic-list-endpoints.mjs diff --git a/doc/api/quic.md b/doc/api/quic.md index ad400bf225b974..abd07d2df7e72e 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -400,6 +400,21 @@ with either a `QuicEndpoint` or `EndpointOptions` as the argument. At most, any single `QuicEndpoint` can only be configured to listen as a server once. +## `quic.listEndpoints([options])` + + + +* `options` {object} + * `active` {boolean} If `true` (the default), only returns endpoints that are + active (not destroyed, not closing, and not busy). If `false` returns all + endpoints. +* Returns: {quic.QuicEndpoint\[]} + +Returns the list of all `QuicEndpoint` instances. By default, only active +endpoints are returned. + ## `quic.constants`