From 060babd66524b6a3e4757bb2fe5b87ad567cdb40 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 1 Jan 2018 11:13:29 -0800 Subject: http2: add initial support for originSet Add new properties to `Http2Session` to identify alpnProtocol, and indicator about whether the session is TLS or not, and initial support for origin set (preparinng for `ORIGIN` frame support and the client-side `Pool` implementation. The `originSet` is the set of origins for which an `Http2Session` may be considered authoritative. Per the `ORIGIN` frame spec, the originSet is only valid on TLS connections, so this is only exposed when using a `TLSSocket`. PR-URL: https://github.com/nodejs/node/pull/17935 Reviewed-By: Anatoli Papirovski Reviewed-By: Sebastiaan Deckers Reviewed-By: Tiancheng "Timothy" Gu --- doc/api/http2.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'doc') diff --git a/doc/api/http2.md b/doc/api/http2.md index e9b06a427c..f613072324 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -283,6 +283,18 @@ session.setTimeout(2000); session.on('timeout', () => { /** .. **/ }); ``` +#### http2session.alpnProtocol + + +* Value: {string|undefined} + +Value will be `undefined` if the `Http2Session` is not yet connected to a +socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or +will return the value of the connected `TLSSocket`'s own `alpnProtocol` +property. + #### http2session.close([callback]) + +* Value: {boolean|undefined} + +Value is `undefined` if the `Http2Session` session socket has not yet been +connected, `true` if the `Http2Session` is connected with a `TLSSocket`, +and `false` if the `Http2Session` is connected to any other kind of socket +or stream. + #### http2session.goaway([code, [lastStreamID, [opaqueData]]]) + +* Value: {string[]|undefined} + +If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property +will return an Array of origins for which the `Http2Session` may be +considered authoritative. + #### http2session.pendingSettingsAck