You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-httpbis-connect-tcp.md
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -64,11 +64,17 @@ This specification describes an alternative mechanism for proxying TCP in HTTP.
64
64
65
65
# Specification
66
66
67
-
A template-driven TCP transport proxy for HTTP is identified by a URI Template {{!RFC6570}} containing variables named "target_host" and "target_port". This URI Template and its variable values MUST meet all the same requirements as for UDP proxying ({{!RFC9298, Section 2}}), and are subject to the same validation rules. The client MUST substitute the destination host and port number into this template to produce the request URI. The derived URI serves as the destination of a Capsule Protocol connection using the Upgrade Token "connect-tcp" (see registration in {#new-upgrade-token}).
67
+
A template-driven TCP transport proxy for HTTP is identified by a URI Template {{!RFC6570}} containing variables named "target_host" and "target_port". This URI Template and its variable values MUST meet all the same requirements as for UDP proxying ({{!RFC9298, Section 2}}), and are subject to the same validation rules. The client MUST substitute the destination host and port number into this template to produce the request URI. The derived URI serves as the destination of a Capsule Protocol connection using the Upgrade Token "connect-tcp" (see registration in {{new-upgrade-token}}).
68
68
69
-
When using "connect-tcp", TCP payload data is sent in the payload of a new Capsule Type named DATA (see registration in {{data-capsule}}). The ordered concatenation of DATA capsule payloads represents the TCP payload data.
69
+
When using "connect-tcp", TCP payload data is sent in the payload of new Capsule Types named DATA and FINAL_DATA (see registrations in {{data-capsule}}). The ordered concatenation of these capsule payloads represents the TCP payload data. A FINAL_DATA capsule indicates that sender has closed this stream, semantically equivalent to TCP FIN. After sending a FINAL_DATA capsule, an endpoint MUST NOT send any more DATA or FINAL_DATA capsules on this data stream. (See {{closing-connections}} for related requirements.)
70
70
71
-
An intermediary MAY split a DATA capsule into two consecutive capsules or merge two consecutive DATA capsules into one. Future CPUTs may use DATA capsules to represent their main data stream, if applicable.
71
+
An intermediary MAY merge and split successive DATA and FINAL_DATA capsules, subject to the following requirements:
72
+
73
+
* There are no intervening capsules of other types.
74
+
* The order of payload content is preserved.
75
+
* The final emitted capsule uses the same capsule type (DATA or FINAL_DATA) as the final input capsule, and all others use the DATA capsule type.
76
+
77
+
In "connect-tcp", Context ID 0 is reserved for DATA, and Context ID 1 is reserved for FINAL_DATA. Future CPUTs may also use DATA and FINAL_DATA capsules to represent their main data stream, if applicable.
72
78
73
79
## In HTTP/1.1
74
80
@@ -156,8 +162,9 @@ Clients SHOULD assume that all proxy resources generated by a single template sh
156
162
157
163
In each HTTP version, any requirements related to closing connections in Classic HTTP CONNECT also apply to "connect-tcp", with the following modifications:
158
164
159
-
* In HTTP/1.1, endpoints SHOULD terminate the connection with an incomplete DATA capsule (as defined in {{Section 3.3 of !RFC9297}}) to indicate receipt of a TCP connection error (e.g., a TCP RST or timeout). When a connection is terminated with any incomplete capsule, or with an error in the underlying connection (e.g. a TLS "internal_error" alert or TCP RST), the endpoint SHOULD send a TCP RST if the underlying TCP implementation permits it.
160
-
* In HTTP/2 and HTTP/3, senders MAY use an incomplete DATA capsule to indicate a TCP connection error, instead of (or in addition to) the signals defined for TCP connection errors in Classic HTTP CONNECT. Recipients MUST recognize an incomplete DATA capsule as a TCP connection error.
165
+
* If the TCP sender send a TCP FIN indicating clean shutdown, the endpoint in this specification MUST send a FINAL_DATA capsule.
166
+
* When a connection is terminated without a FINAL_DATA capsule, the endpoint SHOULD send a TCP RST if the underlying TCP implementation permits it.
167
+
* In HTTP/2 and HTTP/3, senders MAY additionally set stream-level error flags as in Classic HTTP CONNECT.
161
168
162
169
# Additional Connection Setup Behaviors
163
170
@@ -244,11 +251,10 @@ IF APPROVED, IANA is requested to add the following entry to the "MASQUE URI Suf
244
251
245
252
IF APPROVED, IANA is requested to add the following entry to the "HTTP Capsule Types" registry:
0 commit comments