mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc: document this binding in TLS callbacks
Document that `this` is bound to the `tls.TLSSocket` instance when `SNICallback` and `ALPNCallback` are invoked. Signed-off-by: Robert I Nilsson <robert.i.nilsson@callclue.com> PR-URL: https://github.com/nodejs/node/pull/66682 Reviewed-By: Tim Perry <pimterry@gmail.com>
This commit is contained in:
1 parent
933cb117c9
commit
8aa19d23d1
1 file changed
+4
-2
+4
-2
@@ -2252,7 +2252,8 @@ changes:
|
||||
e.g. `0x05hello0x05world`, where the first byte is the length of the next
|
||||
protocol name. Passing an array is usually much simpler, e.g.
|
||||
`['hello', 'world']`. (Protocols should be ordered by their priority.)
|
||||
* `ALPNCallback` {Function} If set, this will be called when a
|
||||
* `ALPNCallback` {Function} If set, this will be called
|
||||
(with `this` set to the `tls.TLSSocket` instance) when a
|
||||
client opens a connection using the ALPN extension. One argument will
|
||||
be passed to the callback: an object containing `servername` and
|
||||
`protocols` fields, respectively containing the server name from
|
||||
@@ -2282,7 +2283,8 @@ changes:
|
||||
[Session Resumption][] for more information. **Default:** `300`.
|
||||
* `SNICallback(servername, callback)` {Function} A function that will be
|
||||
called if the client supports SNI TLS extension. Two arguments will be
|
||||
passed when called: `servername` and `callback`. `callback` is an
|
||||
passed when called: `servername` and `callback`, with `this` set to the
|
||||
`tls.TLSSocket` instance associated with the connection. `callback` is an
|
||||
error-first callback that takes two optional arguments: `error` and `ctx`.
|
||||
`ctx`, if provided, is a `SecureContext` instance.
|
||||
[`tls.createSecureContext()`][] can be used to get a proper `SecureContext`.
|
||||
|
||||
Reference in new issue
Block a user