Skip to content

Conversation

@som14062005
Copy link

Fixes #61047

Added documentation for the ALPNCallback option in new tls.TLSSocket()
which was previously undocumented but functional.

This option allows server-side TLS sockets to dynamically select ALPN
protocols when isServer is true.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem. labels Dec 13, 2025
@ikeyan
Copy link

ikeyan commented Dec 15, 2025

@som14062005 options.session is duplicated by mistake.

@som14062005
Copy link
Author

som14062005 commented Dec 15, 2025

@ikeyan Good catch! I've removed the duplicate options.session entry. Thanks for the review!

doc/api/tls.md Outdated
Comment on lines 902 to 906
* `ALPNCallback` {Function} A callback function that will be called when a
client supports ALPN to select a protocol from the list offered by the
client. The callback receives an object with `servername` and `protocols`
properties. Should return a string from the `protocols` list or `undefined`
if none match. Only used when `isServer` is `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `ALPNCallback` {Function} A callback function that will be called when a
client supports ALPN to select a protocol from the list offered by the
client. The callback receives an object with `servername` and `protocols`
properties. Should return a string from the `protocols` list or `undefined`
if none match. Only used when `isServer` is `true`.
* `ALPNCallback`: See [`tls.createServer()`][]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpinca Good suggestion,I've simplified the documentation to use a cross-reference to tls.createServer() for consistency. Thanks for the feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc: new tls.TLSSocket() supportsALPNCallback option but it is undocumented

4 participants