Support for forwarded mode is determined by the "Proxy-QUIC-Forwarding" header,
see Section 3.1.¶
Once the client has learned the target server's Connection ID, such as in the
response to a QUIC Initial packet, it can send a REGISTER_TARGET_CID capsule
containing the target CID to request the ability to forward packets.¶
Forwarded mode requires connection IDs to be registered and Virtual Connection
IDs to be issued, and, as a consequence, cannot be leveraged without a round
trip. This is particularly pronounced when chaining proxies because
registration happens sequentially. While waiting for forwarded mode to become
enabled, clients SHOULD communicate over tunnelled mode to avoid end-to-end
delays.¶
Prior to receiving the proxy's response, the client MUST send short header
packets tunnelled in HTTP Datagram frames. The client MAY also choose to tunnel
some short header packets even after receiving the successful response.¶
If the proxy rejects the target CID registration or does not issue any target
VCIDs for it, the client continues to use tunnelled mode for that target CID.¶
QUIC long header packets MUST NOT be forwarded. These packets can only be
tunnelled within HTTP Datagram frames to avoid exposing unnecessary connection
metadata.¶
When forwarding, the client sends a QUIC packet with the target VCID
in the QUIC short header, using the same 4-tuple between client and
proxy that was used for the main QUIC connection between client and proxy.¶
The proxy will forward to the target any short header packets received from
the client that use one of its target VCIDs, after first rewriting the target
VCID to be the correct target CID and executing the negotiated transform.¶
The proxy MUST only forward non-tunnelled packets from the client that are QUIC
short header packets (based on the Header Form bit), that use target VCIDs that
the proxy has issued and that have not been retired, and that arrive from a
client address from which the proxy accepts forwarded mode packets
(Section 5.9).
Packets sent by the client that are forwarded SHOULD be
considered as activity for restarting QUIC's Idle Timeout [QUIC].¶
When forwarding, the proxy sends a QUIC packet with the client VCID
in the QUIC short header, using the same 4-tuple between client
and proxy that was used for the main QUIC connection between client and proxy.¶
Prior to sending a forwarded mode packet, the sender MUST replace the Connection
ID with the Virtual Connection ID. If the Virtual Connection ID is larger than
the Connection ID, the sender MUST extend the length of the packet by the
difference between the two lengths, to include the entire Virtual Connection ID.
If the Virtual Connection ID is smaller than the Connection ID, the sender MUST
shrink the length of the packet by the difference between the two lengths.¶
Clients and proxies supporting forwarded mode MUST be able to handle Virtual
Connection IDs of different lengths than the corresponding Connection IDs.¶