From 6b290e186ef32e3bb6ecd74f35e64c0f73e36bcd Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Mon, 8 Apr 2024 19:31:32 -0400 Subject: [PATCH 01/10] Add protocols constructor argument to WebTransport --- index.bs | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index c746a77..fbc5526 100644 --- a/index.bs +++ b/index.bs @@ -180,13 +180,18 @@ A [=WebTransport session=] has the following capabilities defined in [[!WEB-TRAN -To establish a [=WebTransport session=] with an [=/origin=] |origin|, +To establish a [=WebTransport session=] with an [=/origin=] |origin| and a +|protocols| array, follow [[!WEB-TRANSPORT-OVERVIEW]] [Section 4.1](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-overview-06#section-4.1-2.2.1), with using |origin|, [=ASCII serialization of an origin|serialized=] and [=isomorphic encoded=], as the [:Origin:] header of the request. When establishing a session, the client MUST NOT provide any [=credentials=]. The resulting underlying transport stream is referred to as the session's CONNECT stream. +Additionally, if the [=underlying connection=] is using HTTP/3 and the |protocols| array is non-empty, +add a `WebTransport-Subprotocols-Available` header field containing [=isomorphic encoded=] |protocols| +in the CONNECT request following [[!WEB-TRANSPORT-HTTP3]] +[Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). A [=WebTransport session=] |session| is draining when the [=CONNECT stream=] receives an [=session-signal/DRAIN_WEBTRANSPORT_SESSION=] capsule, or when a @@ -610,6 +615,7 @@ interface WebTransport { readonly attribute WebTransportCongestionControl congestionControl; [EnforceRange] attribute unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams; [EnforceRange] attribute unsigned short? anticipatedConcurrentIncomingBidirectionalStreams; + readonly attribute DOMString protocol; readonly attribute Promise<WebTransportCloseInfo> closed; readonly attribute Promise<undefined> draining; @@ -703,6 +709,11 @@ A {{WebTransport}} object has the following internal slots. The number of concurrently open [=bidirectional=] streams the application anticipates the server creating, or null. + + `[[Protocol]]` + A string indicating the subprotocol selected by the server, + if any. Initially an empty string. + `[[Closed]]` A promise fulfilled when the associated {{WebTransport}} object is @@ -749,6 +760,14 @@ agent MUST run the following steps: congestion control algorithms that optimize for |congestionControl|, as allowed by [[!RFC9002]] [Section 7](https://www.rfc-editor.org/rfc/rfc9002#section-7), then set |congestionControl| to `"default"`. +1. Let |protocols| be {{WebTransport/constructor(url, options)/options}}'s + {{WebTransportOptions/protocols}} +1. If any of the values in |protocols| occur more than once, fail to match + the requirements for elements that comprise the value of `WebTransport-Subprotocol` + fields as defined by the WebTransport protocol, or have an [=isomorphic encoded=] + length exceeding 512, [=throw=] a {{SyntaxError}} exception. + [[!WEB-TRANSPORT-HTTP3]] + [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). 1. Let |anticipatedConcurrentIncomingUnidirectionalStreams| be {{WebTransport/constructor(url, options)/options}}'s {{WebTransportOptions/anticipatedConcurrentIncomingUnidirectionalStreams}}. 1. Let |anticipatedConcurrentIncomingBidirectionalStreams| be {{WebTransport/constructor(url, options)/options}}'s @@ -779,6 +798,8 @@ agent MUST run the following steps: :: |anticipatedConcurrentIncomingUnidirectionalStreams| : {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} :: |anticipatedConcurrentIncomingBidirectionalStreams| + : {{[[Protocol]]}} + :: an empty string : {{[[Closed]]}} :: a new promise : {{[[Draining]]}} @@ -811,7 +832,7 @@ This will ensure the stream is not errored due to a datagram being larger than t [=ReadableStream/set up/pullAlgorithm=] set to |pullUnidirectionalStreamAlgorithm|, and [=ReadableStream/set up/highWaterMark=] set to 0. 1. [=Initialize WebTransport over HTTP=] with |transport|, |parsedURL|, |dedicated|, - |requireUnreliable|, |congestionControl|, and |serverCertificateHashes|. + |requireUnreliable|, |congestionControl|, |protocols|, and |serverCertificateHashes|. 1. Return |transport|. @@ -819,7 +840,8 @@ This will ensure the stream is not errored due to a datagram being larger than t
To initialize WebTransport over HTTP, given a {{WebTransport}} object transport, a [=URL record=] |url|, a boolean |dedicated|, a boolean -|http3Only|, a {{WebTransportCongestionControl}} |congestionControl|, and a +|http3Only|, a {{WebTransportCongestionControl}} |congestionControl|, +a |protocols| array, and a sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Let |client| be |transport|'s [=relevant settings object=]. @@ -865,7 +887,7 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Let |error| be a newly [=DOMException/created=] {{WebTransportError}} whose {{WebTransportErrorOptions/source}} is `"session"`. 1. [=Cleanup=] |transport| with |error|. - 1. [=session/Establish=] a [=WebTransport session=] with |origin| on |connection|. + 1. [=session/Establish=] a [=WebTransport session=] with |origin| and |protocols| on |connection|. Note: This step also contains the transport parameter exchange specified in [[!QUIC-DATAGRAM]]. @@ -883,7 +905,10 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Abort these steps. 1. Set |transport|.{{[[State]]}} to `"connected"`. 1. Set |transport|.{{[[Session]]}} to |session|. - 1. If the connection is an HTTP/3 connection, set |transport|'s {{[[Reliability]]}} to `"supports-unreliable"`. + 1. If the connection is an HTTP/3 connection, set |transport|'s {{[[Reliability]]}} to `"supports-unreliable"`, + and set {{[[Protocol]]}} to the `WebTransport-Subprotocol` header field in the 2xx response to the + CONNECT request, following [[!WEB-TRANSPORT-HTTP3]] + [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). 1. If the connection is an HTTP/2 connection [[!WEB-TRANSPORT-HTTP2]], set |transport|'s {{[[Reliability]]}} to `"reliable-only"`. 1. [=Resolve=] |transport|.{{[[Ready]]}} with undefined. @@ -1005,6 +1030,12 @@ Note: Setting {{WebTransport/anticipatedConcurrentIncomingUnidirectionalStreams} {{WebTransport/anticipatedConcurrentIncomingBidirectionalStreams}} does not guarantee the application will receive the number of streams it anticipates. +: protocol +:: Once a [=WebTransport session=] has been established and the {{protocols}} + constructor option was used to provide a non-empty array, returns the subprotocol + selected by the server, if any. Otherwise, an empty string. + The getter steps are to return [=this=]'s {{[[Protocol]]}}. + ## Methods ## {#webtransport-methods}
@@ -1294,6 +1325,7 @@ dictionary WebTransportOptions { WebTransportCongestionControl congestionControl = "default"; [EnforceRange] unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams = null; [EnforceRange] unsigned short? anticipatedConcurrentIncomingBidirectionalStreams = null; + sequence<DOMString> protocols = []; }; enum WebTransportCongestionControl { @@ -1357,6 +1389,10 @@ that determine how the [=WebTransport session=] is established and used. {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} into consideration in its negotiations with the server. +: protocols +:: An optionally provided array of subprotocol names. The connection will only be established if + the server reports that it has selected one of these subprotocols. +
To compute a certificate hash, given a |certificate|, perform the following steps: 1. Let |cert| be |certificate|, represented as a DER encoding of From 1aea6f1530c168f7a966bb9ec45fc8745622c5e3 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 9 Apr 2024 09:52:14 -0400 Subject: [PATCH 02/10] Add "if present" --- index.bs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index fbc5526..2beff3b 100644 --- a/index.bs +++ b/index.bs @@ -181,8 +181,7 @@ A [=WebTransport session=] has the following capabilities defined in [[!WEB-TRAN To establish a [=WebTransport session=] with an [=/origin=] |origin| and a -|protocols| array, -follow [[!WEB-TRANSPORT-OVERVIEW]] +|protocols| array, follow [[!WEB-TRANSPORT-OVERVIEW]] [Section 4.1](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-overview-06#section-4.1-2.2.1), with using |origin|, [=ASCII serialization of an origin|serialized=] and [=isomorphic encoded=], as the [:Origin:] header of the request. @@ -907,7 +906,7 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Set |transport|.{{[[Session]]}} to |session|. 1. If the connection is an HTTP/3 connection, set |transport|'s {{[[Reliability]]}} to `"supports-unreliable"`, and set {{[[Protocol]]}} to the `WebTransport-Subprotocol` header field in the 2xx response to the - CONNECT request, following [[!WEB-TRANSPORT-HTTP3]] + CONNECT request if present, following [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). 1. If the connection is an HTTP/2 connection [[!WEB-TRANSPORT-HTTP2]], set |transport|'s {{[[Reliability]]}} to `"reliable-only"`. 1. [=Resolve=] |transport|.{{[[Ready]]}} with undefined. From b5714ad7eace11017da86969338b9d81d7614db5 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 9 Apr 2024 09:55:00 -0400 Subject: [PATCH 03/10] Specify object internal slot is on --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 2beff3b..96a010c 100644 --- a/index.bs +++ b/index.bs @@ -904,9 +904,9 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Abort these steps. 1. Set |transport|.{{[[State]]}} to `"connected"`. 1. Set |transport|.{{[[Session]]}} to |session|. - 1. If the connection is an HTTP/3 connection, set |transport|'s {{[[Reliability]]}} to `"supports-unreliable"`, - and set {{[[Protocol]]}} to the `WebTransport-Subprotocol` header field in the 2xx response to the - CONNECT request if present, following [[!WEB-TRANSPORT-HTTP3]] + 1. If the connection is an HTTP/3 connection, set |transport|.{{[[Reliability]]}} to `"supports-unreliable"`, + and set |transport|.{{[[Protocol]]}} to the `WebTransport-Subprotocol` header field in the 2xx response to + the CONNECT request if present, following [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). 1. If the connection is an HTTP/2 connection [[!WEB-TRANSPORT-HTTP2]], set |transport|'s {{[[Reliability]]}} to `"reliable-only"`. 1. [=Resolve=] |transport|.{{[[Ready]]}} with undefined. From ce6d137f0410b1a1bd7ebbe1874216ef29883731 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 23 Apr 2024 14:50:57 -0400 Subject: [PATCH 04/10] s/protocols/subprotocols/ Co-authored-by: Nidhi Jaju <41948741+nidhijaju@users.noreply.github.com> --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 96a010c..c956587 100644 --- a/index.bs +++ b/index.bs @@ -181,7 +181,7 @@ A [=WebTransport session=] has the following capabilities defined in [[!WEB-TRAN To establish a [=WebTransport session=] with an [=/origin=] |origin| and a -|protocols| array, follow [[!WEB-TRANSPORT-OVERVIEW]] +|subprotocols| array, follow [[!WEB-TRANSPORT-OVERVIEW]] [Section 4.1](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-overview-06#section-4.1-2.2.1), with using |origin|, [=ASCII serialization of an origin|serialized=] and [=isomorphic encoded=], as the [:Origin:] header of the request. From 63174b0cca66f9fc454594be5ca52d1ebfebfacd Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 23 Apr 2024 15:00:23 -0400 Subject: [PATCH 05/10] maintain subprotocol order in header and reject on empty strings --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index c956587..b539dd4 100644 --- a/index.bs +++ b/index.bs @@ -188,8 +188,8 @@ as the [:Origin:] header of the request. When establishing a session, the client MUST NOT provide any [=credentials=]. The resulting underlying transport stream is referred to as the session's CONNECT stream. Additionally, if the [=underlying connection=] is using HTTP/3 and the |protocols| array is non-empty, -add a `WebTransport-Subprotocols-Available` header field containing [=isomorphic encoded=] |protocols| -in the CONNECT request following [[!WEB-TRANSPORT-HTTP3]] +add a `WebTransport-Subprotocols-Available` header field to the CONNECT request, containing +[=isomorphic encoded=] protocols from |protocols| in the order given, following [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). A [=WebTransport session=] |session| is draining when the @@ -764,7 +764,7 @@ agent MUST run the following steps: 1. If any of the values in |protocols| occur more than once, fail to match the requirements for elements that comprise the value of `WebTransport-Subprotocol` fields as defined by the WebTransport protocol, or have an [=isomorphic encoded=] - length exceeding 512, [=throw=] a {{SyntaxError}} exception. + length of 0 or exceeding 512, [=throw=] a {{SyntaxError}} exception. [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). 1. Let |anticipatedConcurrentIncomingUnidirectionalStreams| be {{WebTransport/constructor(url, options)/options}}'s From 55edef9d908da5447157c4a14c3d4f3f8b93b759 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 16 Jul 2024 18:53:14 -0400 Subject: [PATCH 06/10] s/protocols/subprotocols/ in API --- index.bs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.bs b/index.bs index d006286..84c5c05 100644 --- a/index.bs +++ b/index.bs @@ -187,9 +187,9 @@ with using |origin|, [=ASCII serialization of an origin|serialized=] and [=isomo as the [:Origin:] header of the request. When establishing a session, the client MUST NOT provide any [=credentials=]. The resulting underlying transport stream is referred to as the session's CONNECT stream. -Additionally, if the [=underlying connection=] is using HTTP/3 and the |protocols| array is non-empty, +Additionally, if the [=underlying connection=] is using HTTP/3 and the |subprotocols| array is non-empty, add a `WebTransport-Subprotocols-Available` header field to the CONNECT request, containing -[=isomorphic encoded=] protocols from |protocols| in the order given, following [[!WEB-TRANSPORT-HTTP3]] +[=isomorphic encoded=] subprotocols from |subprotocols| in the order given, following [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). A [=WebTransport session=] |session| is draining when the @@ -760,9 +760,9 @@ agent MUST run the following steps: congestion control algorithms that optimize for |congestionControl|, as allowed by [[!RFC9002]] [Section 7](https://www.rfc-editor.org/rfc/rfc9002#section-7), then set |congestionControl| to `"default"`. -1. Let |protocols| be {{WebTransport/constructor(url, options)/options}}'s - {{WebTransportOptions/protocols}} -1. If any of the values in |protocols| occur more than once, fail to match +1. Let |subprotocols| be {{WebTransport/constructor(url, options)/options}}'s + {{WebTransportOptions/subprotocols}} +1. If any of the values in |subprotocols| occur more than once, fail to match the requirements for elements that comprise the value of `WebTransport-Subprotocol` fields as defined by the WebTransport protocol, or have an [=isomorphic encoded=] length of 0 or exceeding 512, [=throw=] a {{SyntaxError}} exception. @@ -832,7 +832,7 @@ This will ensure the stream is not errored due to a datagram being larger than t [=ReadableStream/set up/pullAlgorithm=] set to |pullUnidirectionalStreamAlgorithm|, and [=ReadableStream/set up/highWaterMark=] set to 0. 1. [=Initialize WebTransport over HTTP=] with |transport|, |parsedURL|, |dedicated|, - |requireUnreliable|, |congestionControl|, |protocols|, and |serverCertificateHashes|. + |requireUnreliable|, |congestionControl|, |subprotocols|, and |serverCertificateHashes|. 1. Return |transport|.
@@ -841,7 +841,7 @@ This will ensure the stream is not errored due to a datagram being larger than t To initialize WebTransport over HTTP, given a {{WebTransport}} object transport, a [=URL record=] |url|, a boolean |dedicated|, a boolean |requireUnreliable|, a {{WebTransportCongestionControl}} |congestionControl|, -a |protocols| array, and a +a |subprotocols| array, and a sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Let |client| be |transport|'s [=relevant settings object=]. @@ -887,7 +887,7 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Let |error| be a newly [=DOMException/created=] {{WebTransportError}} whose {{WebTransportErrorOptions/source}} is `"session"`. 1. [=Cleanup=] |transport| with |error|. - 1. [=session/Establish=] a [=WebTransport session=] with |origin| and |protocols| on |connection|. + 1. [=session/Establish=] a [=WebTransport session=] with |origin| and |subprotocols| on |connection|. Note: This step also contains the transport parameter exchange specified in [[!QUIC-DATAGRAM]]. @@ -1031,7 +1031,7 @@ Note: Setting {{WebTransport/anticipatedConcurrentIncomingUnidirectionalStreams} the application will receive the number of streams it anticipates. : protocol -:: Once a [=WebTransport session=] has been established and the {{protocols}} +:: Once a [=WebTransport session=] has been established and the {{subprotocols}} constructor option was used to provide a non-empty array, returns the subprotocol selected by the server, if any. Otherwise, an empty string. The getter steps are to return [=this=]'s {{[[Protocol]]}}. @@ -1327,7 +1327,7 @@ dictionary WebTransportOptions { WebTransportCongestionControl congestionControl = "default"; [EnforceRange] unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams = null; [EnforceRange] unsigned short? anticipatedConcurrentIncomingBidirectionalStreams = null; - sequence<DOMString> protocols = []; + sequence<DOMString> subprotocols = []; }; enum WebTransportCongestionControl { @@ -1391,7 +1391,7 @@ that determine how the [=WebTransport session=] is established and used. {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} into consideration in its negotiations with the server. -: protocols +: subprotocols :: An optionally provided array of subprotocol names. The connection will only be established if the server reports that it has selected one of these subprotocols. From afccefdd33eca368b5be8d3d91409108b4497a6b Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 30 Jul 2024 09:52:32 -0400 Subject: [PATCH 07/10] s/subprotocol/protocol/ in API only, leaving subprotocol in prose --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 84c5c05..bd3599d 100644 --- a/index.bs +++ b/index.bs @@ -761,7 +761,7 @@ agent MUST run the following steps: [[!RFC9002]] [Section 7](https://www.rfc-editor.org/rfc/rfc9002#section-7), then set |congestionControl| to `"default"`. 1. Let |subprotocols| be {{WebTransport/constructor(url, options)/options}}'s - {{WebTransportOptions/subprotocols}} + {{WebTransportOptions/protocols}} 1. If any of the values in |subprotocols| occur more than once, fail to match the requirements for elements that comprise the value of `WebTransport-Subprotocol` fields as defined by the WebTransport protocol, or have an [=isomorphic encoded=] @@ -1031,7 +1031,7 @@ Note: Setting {{WebTransport/anticipatedConcurrentIncomingUnidirectionalStreams} the application will receive the number of streams it anticipates. : protocol -:: Once a [=WebTransport session=] has been established and the {{subprotocols}} +:: Once a [=WebTransport session=] has been established and the {{protocols}} constructor option was used to provide a non-empty array, returns the subprotocol selected by the server, if any. Otherwise, an empty string. The getter steps are to return [=this=]'s {{[[Protocol]]}}. @@ -1327,7 +1327,7 @@ dictionary WebTransportOptions { WebTransportCongestionControl congestionControl = "default"; [EnforceRange] unsigned short? anticipatedConcurrentIncomingUnidirectionalStreams = null; [EnforceRange] unsigned short? anticipatedConcurrentIncomingBidirectionalStreams = null; - sequence<DOMString> subprotocols = []; + sequence<DOMString> protocols = []; }; enum WebTransportCongestionControl { @@ -1391,7 +1391,7 @@ that determine how the [=WebTransport session=] is established and used. {{[[AnticipatedConcurrentIncomingBidirectionalStreams]]}} into consideration in its negotiations with the server. -: subprotocols +: protocols :: An optionally provided array of subprotocol names. The connection will only be established if the server reports that it has selected one of these subprotocols. From 33909349769e4a21beb5e4823c427aa8c353d3c1 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Mon, 9 Sep 2024 15:26:10 -0400 Subject: [PATCH 08/10] Update to match latest header field names; add notes --- index.bs | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/index.bs b/index.bs index bd3599d..515a1d0 100644 --- a/index.bs +++ b/index.bs @@ -131,6 +131,8 @@ specification uses that specification and terminology. There are two main protocol concepts for WebTransport: sessions and streams. Each [=WebTransport session=] can contain multiple [=WebTransport streams=]. +These should not be confused with [=subprotocol names=] which is an application-level API construct. + ## WebTransport session ## {#webtransport-session} A WebTransport session is a session of WebTransport over an HTTP/3 @@ -187,10 +189,14 @@ with using |origin|, [=ASCII serialization of an origin|serialized=] and [=isomo as the [:Origin:] header of the request. When establishing a session, the client MUST NOT provide any [=credentials=]. The resulting underlying transport stream is referred to as the session's CONNECT stream. -Additionally, if the [=underlying connection=] is using HTTP/3 and the |subprotocols| array is non-empty, -add a `WebTransport-Subprotocols-Available` header field to the CONNECT request, containing +Additionally, if the |subprotocols| array is non-empty, +add a `WT-Available-Protocols` header field to the CONNECT request, containing [=isomorphic encoded=] subprotocols from |subprotocols| in the order given, following [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). +
+ This should reference [[!WEB-TRANSPORT-OVERVIEW]] instead pending + [issue 15](https://github.com/ietf-wg-webtrans/draft-ietf-webtrans-overview/issues/15). +
A [=WebTransport session=] |session| is draining when the [=CONNECT stream=] receives an [=session-signal/DRAIN_WEBTRANSPORT_SESSION=] capsule, or when a @@ -763,7 +769,7 @@ agent MUST run the following steps: 1. Let |subprotocols| be {{WebTransport/constructor(url, options)/options}}'s {{WebTransportOptions/protocols}} 1. If any of the values in |subprotocols| occur more than once, fail to match - the requirements for elements that comprise the value of `WebTransport-Subprotocol` + the requirements for elements that comprise the value of `WT-Protocol` fields as defined by the WebTransport protocol, or have an [=isomorphic encoded=] length of 0 or exceeding 512, [=throw=] a {{SyntaxError}} exception. [[!WEB-TRANSPORT-HTTP3]] @@ -905,10 +911,15 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Abort these steps. 1. Set |transport|.{{[[State]]}} to `"connected"`. 1. Set |transport|.{{[[Session]]}} to |session|. - 1. If the connection is an HTTP/3 connection, set |transport|.{{[[Reliability]]}} to `"supports-unreliable"`, - and set |transport|.{{[[Protocol]]}} to the `WebTransport-Subprotocol` header field in the 2xx response to - the CONNECT request if present, following [[!WEB-TRANSPORT-HTTP3]] - [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4). + 1. Set |transport|.{{[[Protocol]]}} to either the string value of the `WT-Protocol` header field + in the 2xx response to the CONNECT request if present, following [[!WEB-TRANSPORT-HTTP3]] + [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4), + or `""` if not present. +
+ This should reference [[!WEB-TRANSPORT-OVERVIEW]] instead pending + [issue 15](https://github.com/ietf-wg-webtrans/draft-ietf-webtrans-overview/issues/15). +
+ 1. If the connection is an HTTP/3 connection, set |transport|.{{[[Reliability]]}} to `"supports-unreliable"`. 1. If the connection is an HTTP/2 connection [[!WEB-TRANSPORT-HTTP2]], set |transport|'s {{[[Reliability]]}} to `"reliable-only"`. 1. [=Resolve=] |transport|.{{[[Ready]]}} with undefined. @@ -1392,8 +1403,9 @@ that determine how the [=WebTransport session=] is established and used. negotiations with the server. : protocols -:: An optionally provided array of subprotocol names. The connection will only be established if - the server reports that it has selected one of these subprotocols. +:: An optionally provided array of application-level subprotocol names. The connection + will only be established if the server reports that it has selected one of these + application-level subprotocols.
To compute a certificate hash, given a |certificate|, perform the following steps: From d4f566fc4dafe10d0fca4f29d9c8714b2b1ed280 Mon Sep 17 00:00:00 2001 From: Nidhi Jaju <41948741+nidhijaju@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:07:26 +0900 Subject: [PATCH 09/10] Apply suggestions from code review --- index.bs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/index.bs b/index.bs index 515a1d0..e669200 100644 --- a/index.bs +++ b/index.bs @@ -131,7 +131,7 @@ specification uses that specification and terminology. There are two main protocol concepts for WebTransport: sessions and streams. Each [=WebTransport session=] can contain multiple [=WebTransport streams=]. -These should not be confused with [=subprotocol names=] which is an application-level API construct. +These should not be confused with [=protocol names=] which is an application-level API construct. ## WebTransport session ## {#webtransport-session} @@ -183,15 +183,15 @@ A [=WebTransport session=] has the following capabilities defined in [[!WEB-TRAN To establish a [=WebTransport session=] with an [=/origin=] |origin| and a -|subprotocols| array, follow [[!WEB-TRANSPORT-OVERVIEW]] +|protocols| array, follow [[!WEB-TRANSPORT-OVERVIEW]] [Section 4.1](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-overview-06#section-4.1-2.2.1), with using |origin|, [=ASCII serialization of an origin|serialized=] and [=isomorphic encoded=], as the [:Origin:] header of the request. When establishing a session, the client MUST NOT provide any [=credentials=]. The resulting underlying transport stream is referred to as the session's CONNECT stream. -Additionally, if the |subprotocols| array is non-empty, +Additionally, if the |protocols| array is non-empty, add a `WT-Available-Protocols` header field to the CONNECT request, containing -[=isomorphic encoded=] subprotocols from |subprotocols| in the order given, following [[!WEB-TRANSPORT-HTTP3]] +[=isomorphic encoded=] protocols from |protocols| in the order given, following [[!WEB-TRANSPORT-HTTP3]] [Section 3.4](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-3.4).
This should reference [[!WEB-TRANSPORT-OVERVIEW]] instead pending @@ -716,7 +716,7 @@ A {{WebTransport}} object has the following internal slots. `[[Protocol]]` - A string indicating the subprotocol selected by the server, + A string indicating the application-level protocol selected by the server, if any. Initially an empty string. @@ -766,9 +766,9 @@ agent MUST run the following steps: congestion control algorithms that optimize for |congestionControl|, as allowed by [[!RFC9002]] [Section 7](https://www.rfc-editor.org/rfc/rfc9002#section-7), then set |congestionControl| to `"default"`. -1. Let |subprotocols| be {{WebTransport/constructor(url, options)/options}}'s +1. Let |protocols| be {{WebTransport/constructor(url, options)/options}}'s {{WebTransportOptions/protocols}} -1. If any of the values in |subprotocols| occur more than once, fail to match +1. If any of the values in |protocols| occur more than once, fail to match the requirements for elements that comprise the value of `WT-Protocol` fields as defined by the WebTransport protocol, or have an [=isomorphic encoded=] length of 0 or exceeding 512, [=throw=] a {{SyntaxError}} exception. @@ -838,7 +838,7 @@ This will ensure the stream is not errored due to a datagram being larger than t [=ReadableStream/set up/pullAlgorithm=] set to |pullUnidirectionalStreamAlgorithm|, and [=ReadableStream/set up/highWaterMark=] set to 0. 1. [=Initialize WebTransport over HTTP=] with |transport|, |parsedURL|, |dedicated|, - |requireUnreliable|, |congestionControl|, |subprotocols|, and |serverCertificateHashes|. + |requireUnreliable|, |congestionControl|, |protocols|, and |serverCertificateHashes|. 1. Return |transport|.
@@ -847,7 +847,7 @@ This will ensure the stream is not errored due to a datagram being larger than t To initialize WebTransport over HTTP, given a {{WebTransport}} object transport, a [=URL record=] |url|, a boolean |dedicated|, a boolean |requireUnreliable|, a {{WebTransportCongestionControl}} |congestionControl|, -a |subprotocols| array, and a +a |protocols| array, and a sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Let |client| be |transport|'s [=relevant settings object=]. @@ -893,7 +893,7 @@ sequence<{{WebTransportHash}}> |serverCertificateHashes|, run these steps. 1. Let |error| be a newly [=DOMException/created=] {{WebTransportError}} whose {{WebTransportErrorOptions/source}} is `"session"`. 1. [=Cleanup=] |transport| with |error|. - 1. [=session/Establish=] a [=WebTransport session=] with |origin| and |subprotocols| on |connection|. + 1. [=session/Establish=] a [=WebTransport session=] with |origin| and |protocols| on |connection|. Note: This step also contains the transport parameter exchange specified in [[!QUIC-DATAGRAM]]. @@ -1403,9 +1403,9 @@ that determine how the [=WebTransport session=] is established and used. negotiations with the server. : protocols -:: An optionally provided array of application-level subprotocol names. The connection +:: An optionally provided array of application-level protocol names. The connection will only be established if the server reports that it has selected one of these - application-level subprotocols. + application-level protocols.
To compute a certificate hash, given a |certificate|, perform the following steps: From 6b82382ed47b93188c9220885f5d18bfaea39a23 Mon Sep 17 00:00:00 2001 From: Nidhi Jaju <41948741+nidhijaju@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:13:32 +0900 Subject: [PATCH 10/10] Update index.bs --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index e669200..bb64b5a 100644 --- a/index.bs +++ b/index.bs @@ -1043,7 +1043,7 @@ the application will receive the number of streams it anticipates. : protocol :: Once a [=WebTransport session=] has been established and the {{protocols}} - constructor option was used to provide a non-empty array, returns the subprotocol + constructor option was used to provide a non-empty array, returns the application-level protocol selected by the server, if any. Otherwise, an empty string. The getter steps are to return [=this=]'s {{[[Protocol]]}}.