Draft: draft-ietf-masque-connect-udp

Commentary: PR in response to  's GENART review --
This document describes how to proxy UDP in HTTP, similar to how the
HTTP CONNECT method allows proxying TCP in HTTP.  More specifically,
this document defines a protocol that allows HTTP clients to create a
tunnel for UDP communications through an HTTP server that acts as a
proxy.
While HTTP provides the CONNECT method (see HTTP) for creating a TCP
TCP tunnel to a proxy, it lacks a method for doing so for UDP UDP
traffic.
This document describes how to proxy UDP in HTTP, similar to how the
HTTP CONNECT method allows proxying TCP in HTTP.  More specifically,
this document defines a protocol that allows an HTTP client to create
a tunnel for UDP communications through an HTTP server that acts as a
proxy.
While HTTP provides the CONNECT method (see HTTP) for creating a TCP
TCP tunnel to a proxy, prior to this specification it lacked a method
for doing so for UDP UDP traffic.
This protocol supports all versions of HTTP by using HTTP Datagrams
HTTP-DGRAM.  When using HTTP/2 H2 or HTTP/3 H3, it uses HTTP Extended
CONNECT as described in EXT-CONNECT2 and EXT-CONNECT3.  When using
HTTP/1.x H1, it uses HTTP Upgrade as defined in HTTP.
This protocol supports all existing versions of HTTP by using HTTP
Datagrams HTTP-DGRAM.  When using HTTP/2 H2 or HTTP/3 H3, it uses
HTTP Extended CONNECT as described in EXT-CONNECT2 and EXT-CONNECT3.
When using HTTP/1.x H1, it uses HTTP Upgrade as defined in HTTP.
To initiate a UDP tunnel associated with a single HTTP stream,
clients issue a request containing the "connect-udp" upgrade token.
The target of the tunnel is indicated by the client to the UDP proxy
via the "target_host" and "target_port" variables of the URI
Template, see client-config.  If the request is successful, the UDP
proxy commits to converting received HTTP Datagrams into UDP packets
and vice versa until the tunnel is closed.
To initiate a UDP tunnel associated with a single HTTP stream, a
client issues a request containing the "connect-udp" upgrade token.
The target of the tunnel is indicated by the client to the UDP proxy
via the "target_host" and "target_port" variables of the URI
Template, see client-config.  If the request is successful, the UDP
proxy commits to converting received HTTP Datagrams into UDP packets
and vice versa until the tunnel is closed.
This protocol allows future extensions to exchange HTTP Datagrams
which carry different semantics from UDP payloads.  Some of these
extensions can augment UDP payloads with additional data, while
others can exchange data that is completely separate from UDP
payloads.  In order to accomplish this, all HTTP Datagrams associated
with UDP Proxying request streams start with a context ID, see
format.
The mechanism for proxying UDP in HTTP defined in this document
allows future extensions to exchange HTTP Datagrams which carry
different semantics from UDP payloads.  Some of these extensions can
augment UDP payloads with additional data, while others can exchange
data that is completely separate from UDP payloads.  In order to
accomplish this, all HTTP Datagrams associated with UDP Proxying
request streams start with a context ID, see format.