From 055509af6a3ec6d38d9b2e69abb4d6e4e3ccfb76 Mon Sep 17 00:00:00 2001 From: Taejin Kim Date: Mon, 12 Jan 2026 21:12:10 +0900 Subject: [PATCH] doc: replace alpn with protocol in quic.md The code was refactored in commit 062ae6f3cb5 to use 'protocol' instead of 'alpn' for the ALPN protocol identifier option. However, the documentation was not updated to reflect this change. This commit updates the documentation to match the actual implementation: - Removes the non-functional 'alpn' option from SessionOptions - Adds the 'protocol' option with proper description - Updates example code to use 'protocol' instead of 'alpn' - Updates OnHandshakeCallback parameter from 'alpn' to 'protocol' Refs: https://github.com/nodejs/node/commit/062ae6f3cb5 --- doc/api/quic.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index 723c26c5bd0b99..b43a7485a6aeb3 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -40,8 +40,8 @@ import { connect } from 'node:quic'; import { Buffer } from 'node:buffer'; const enc = new TextEncoder(); -const alpn = 'foo'; -const client = await connect('123.123.123.123:8888', { alpn }); +const protocol = 'foo'; +const client = await connect('123.123.123.123:8888', { protocol }); await client.createUnidirectionalStream({ body: enc.encode('hello world'), }); @@ -1110,16 +1110,6 @@ while establishing a new connection. added: v23.8.0 --> -#### `sessionOptions.alpn` - - - -* Type: {string} - -The ALPN protocol identifier. - #### `sessionOptions.ca` + +* Type: {string} + +The ALPN protocol identifier. This option specifies the application layer protocol +negotiation (ALPN) protocol to use for the session. Common values include `'h3'` for +HTTP/3, `'h2'` for HTTP/2, or custom protocol identifiers. + #### `sessionOptions.qlog`