MASQUE Explained: UDP and IP Proxying over HTTP
MASQUE UDP and IP proxying over HTTP gives a client a standardized way to carry more than ordinary web requests through an HTTP proxy. It is useful when an application needs UDP, QUIC, or arbitrary IP packets to cross a network that already permits HTTPS, but it is not automatically a complete VPN or an anonymity system.
What Is MASQUE?
MASQUE is the IETF working-group name for Multiplexed Application Substrate over QUIC Encryption. In practice, the term commonly refers to a family of HTTP proxying protocols, especially Proxying UDP in HTTP (RFC 9298) and Proxying IP in HTTP (RFC 9484). The IETF MASQUE working group defines the work and describes the goal as running multiple proxied stream- and datagram-based flows inside an HTTP connection.
An ordinary HTTP CONNECT request asks a proxy to create a TCP tunnel. MASQUE extends that model. CONNECT-UDP asks an HTTP server to proxy UDP packets to a selected destination. CONNECT-IP asks it to proxy IP packets, which can include traffic for protocols other than TCP and UDP. The client and proxy exchange these flows using HTTP mechanisms, often HTTP/3 over QUIC, while the proxy performs the actual forwarding to the target.
Why MASQUE Exists
Many networks allow HTTPS but restrict direct UDP or arbitrary IP traffic. A device may need UDP for QUIC, real-time communication, or a protocol that cannot be rewritten as a TCP stream. Traditional HTTP CONNECT is designed for TCP and cannot express a native UDP flow. SOCKS can proxy more traffic, but it introduces a separate signaling protocol and does not provide the HTTP compatibility and multiplexing model that MASQUE targets.
MASQUE uses an HTTP connection as a reachability and policy boundary. A client can authenticate to a proxy, establish several tunnels over one connection, and let HTTP/2 or HTTP/3 carry the control semantics. With HTTP/3, the underlying QUIC connection provides encrypted transport, independent streams, and shared congestion control. RFC 9114 describes how HTTP semantics map onto QUIC and why streams can progress independently.
The design is also useful for network privacy, but its privacy claim is specific. A destination sees the proxy’s address rather than the client’s address when the proxy makes the outbound connection. The proxy sees the client connection and can generally learn the requested target or routing information. MASQUE can move where an observer sits in the path; it does not make the proxy or the destination unable to observe traffic metadata.
How MASQUE Works
A typical deployment has four logical roles:
Application
|
v
MASQUE client
| HTTPS connection, usually HTTP/3 over QUIC
v
HTTP intermediary (optional)
|
v
MASQUE proxy
| UDP socket or IP tunnel
v
Target host or network
The client first opens an authenticated HTTP connection to the proxy. It then sends an extended CONNECT request that identifies the desired protocol and target. The proxy authenticates and authorizes the request, allocates the required forwarding state, and returns a successful response if it can establish the tunnel. After that, the client and proxy exchange protocol data until either side closes the tunnel.
An HTTP intermediary can forward the request to another HTTP server. This is different from the MASQUE proxy’s forwarding role: the intermediary handles HTTP traffic between HTTP endpoints, while the proxy translates the tunneled payload into UDP packets or IP packets. A deployment can have more than one HTTP hop, but each additional hop adds policy, failure modes, and metadata that operators must understand.
CONNECT-UDP
CONNECT-UDP creates a UDP tunnel for a target host and port. The client uses a configured URI Template, such as:
https://proxy.example/.well-known/masque/udp/{target_host}/{target_port}/
The expanded URI identifies the UDP destination. A request uses the connect-udp protocol token. On HTTP/2 and HTTP/3, the exchange uses Extended CONNECT and HTTP Datagrams; on HTTP/1.x, the specification defines an HTTP Upgrade form. The proxy resolves a DNS target when necessary, opens a UDP socket, and converts tunnel payloads into UDP packets in both directions.
The payload is not simply a stream of UDP bytes placed in an HTTP response. RFC 9298 uses the Capsule Protocol and HTTP Datagrams so that the client and proxy can carry datagrams and control messages while respecting the selected HTTP version. HTTP/3 is especially natural for this design because QUIC already supplies encrypted streams and an HTTP/3 connection can multiplex multiple requests.
The UDP destination can be a QUIC server, a DNS service, a game server, or another application that expects datagrams. The proxy does not make UDP reliable. If the application needs reliability, ordering, or retransmission, that behavior must come from the protocol carried inside the UDP tunnel, such as QUIC.
CONNECT-IP
CONNECT-IP goes below the transport layer. Instead of naming only a UDP host and port, the client asks the proxy to forward IP packets. RFC 9484 defines the connect-ip protocol token and permits optional target and ipproto values in the URI Template. The target can represent a destination, a prefix, or a wildcard according to the proxy’s supported policy.
This makes CONNECT-IP suitable for use cases such as remote-access VPNs, site-to-site VPNs, secure point-to-point links, and general packet tunneling. It can carry TCP, UDP, or other IP protocols, but the client and proxy still need a mechanism to configure addresses, routes, authorization, and packet handling. The RFC standardizes the tunnel transport, not a complete VPN control plane.
IP proxying must run over TLS, QUIC encryption, or an equivalent protection mechanism. The client and proxy need confidentiality, integrity, and peer authentication for the HTTP connection. The proxy must also validate the requested scope and avoid becoming an unrestricted packet-forwarding service.
Comparing HTTP tunnel choices
| Feature | HTTP CONNECT | CONNECT-UDP | CONNECT-IP |
|---|---|---|---|
| Primary payload | TCP byte stream | UDP datagrams | IP packets |
| HTTP protocol token | connect |
connect-udp |
connect-ip |
| Target selection | Host and port | Host and port in a URI Template | Optional target and IP protocol |
| Typical use | HTTPS proxying and TCP tunnels | QUIC, DNS, and real-time UDP applications | Remote access, site-to-site, and packet tunnels |
| Reliability | Provided by TCP | Depends on the protocol inside UDP | Depends on the protocols inside IP |
| Tunnel scope | One TCP connection | One UDP flow per request | Potentially multiple IP flows |
| Main operational risk | Long-lived stream resource use | UDP amplification and state exhaustion | Route leaks and broad network exposure |
Components and Key Concepts
HTTP connection and version: MASQUE can use HTTP/1.1, HTTP/2, or HTTP/3 as specified by the relevant protocol. HTTP/3 over QUIC offers multiplexing without TCP’s connection-level head-of-line blocking, but it still requires UDP reachability between the client and proxy. HTTP/1.1 may be easier to pass through some infrastructure but does not provide the same connection-level multiplexing.
Extended CONNECT: The client identifies the tunnel type with the :protocol value, such as connect-udp or connect-ip. The proxy must reject unsupported or unauthorized protocol requests rather than treating an unfamiliar request as an ordinary web resource.
HTTP Datagrams and Capsules: Datagrams carry payloads that do not need reliable, ordered delivery. Capsules carry control information and can be used to signal configuration or errors. Implementations need to enforce maximum sizes and handle loss, duplication, reordering, and tunnel closure.
Proxy policy: A production proxy needs identity authentication, target allowlists or routing rules, per-user quotas, idle timeouts, packet-size limits, rate limits, and abuse controls. UDP and IP forwarding can be used for reflection, scanning, or bypassing network policy if authorization is too broad.
Address and route management: CONNECT-IP requires the client to know which addresses or routes are reachable through the tunnel. The proxy must prevent overlapping tenants, spoofed source addresses, and unauthorized access to internal ranges. Network-layer forwarding is not equivalent to application authorization.
Observability: The proxy can record client identity, tunnel creation time, target, byte counts, packet counts, errors, and timing. Logs should support incident response without storing payloads or sensitive identifiers unnecessarily. Encryption protects content in transit; it does not prevent the proxy from observing metadata it needs to operate.
Real-World Use Cases
For enterprise remote access, CONNECT-IP can place a managed device behind a policy-controlled gateway without exposing every internal service directly to the internet. This resembles a VPN at the packet-forwarding level, but the organization must still define identity, routes, DNS behavior, split tunneling, device posture, and access controls.
For a privacy relay, the proxy can hide a client’s source address from the target. That does not prevent the proxy from seeing the client, the tunnel target, timing, sizes, and possibly the inner protocol’s identifying information. Independent operators, traffic padding, short log retention, and careful application behavior may be needed for stronger privacy goals.
Practical Guide: Evaluate a MASQUE Deployment
Start by identifying the narrowest required tunnel. Use CONNECT-UDP when the application has one UDP-oriented flow. Use CONNECT-IP only when the application genuinely needs packet-level forwarding. Confirm that the proxy operator supports the exact HTTP version, protocol token, authentication method, and target format required by the client.
Check that the local curl build has HTTP/3 support before testing the outer transport:
curl --version
curl --version | grep -i HTTP3
The following command verifies that a test endpoint can be reached over HTTP/3. It does not create a MASQUE tunnel; a MASQUE client must send the Extended CONNECT request and implement Capsules and HTTP Datagrams:
curl --http3-only --fail --show-error --silent \
--output /dev/null \
--write-out 'HTTP/3 probe: %{http_code}\n' \
https://proxy.example/
For a client implementation, record the equivalent request parameters in configuration rather than hard-coding a target:
proxy:
url: "https://proxy.example:443"
protocol: "h3"
authentication: "managed-client-credentials"
tunnels:
- type: "connect-udp"
template: "https://proxy.example/.well-known/masque/udp/{target_host}/{target_port}/"
allowed_targets:
- "resolver.example:443"
- type: "connect-ip"
template: "https://proxy.example/.well-known/masque/ip/{target}/{ipproto}/"
allowed_routes:
- "10.20.0.0/16"
The YAML is a deployment model, not a universal configuration file. Map it to the selected MASQUE implementation and verify that the implementation validates URI templates, target ports, IP protocols, certificates, and credentials. Do not copy a broad wildcard route into production without reviewing the resulting network access.
Test in stages:
- Establish the HTTPS or HTTP/3 connection and verify certificate and proxy authentication failures are visible.
- Create one
CONNECT-UDPtunnel to a controlled test service and compare packets at the client, proxy, and target. - Test loss, reordering, idle timeout, DNS failure, oversized datagrams, and proxy restart.
- For
CONNECT-IP, verify assigned addresses, routes, source-address validation, DNS behavior, and isolation between clients. - Inspect proxy metrics for active tunnels, bytes, drops, rejected targets, and resource exhaustion.
If HTTP/3 fails while ordinary HTTPS works, check UDP reachability and test the HTTP/2 fallback where supported. If the tunnel is accepted but the application fails, verify that the target expects the correct UDP or IP protocol and that path MTU, NAT, and idle timeout behavior are compatible. A successful HTTP response from the proxy is only evidence that the control request was accepted; it does not prove that the inner protocol can reach its destination.
Common Misconceptions
“MASQUE is a VPN.”
CONNECT-IP can carry the packet traffic of a VPN-like design, but MASQUE does not define the complete VPN product. Identity, routes, address assignment, device policy, DNS, key management, and endpoint authorization remain deployment responsibilities.
“The proxy cannot see the destination.”
The proxy needs enough target and routing information to forward the tunnel. It can observe connection metadata, requested scope, timing, sizes, and byte counts even when the inner payload is encrypted. The destination may also identify the client through application credentials or unique traffic.
“UDP through HTTP becomes reliable.”
The outer HTTP mechanism transports datagrams; it does not turn them into a reliable ordered byte stream. QUIC or another inner protocol may provide reliability, but an application that sends raw UDP must tolerate loss, reordering, and duplication according to its own design.
“HTTP/3 support means MASQUE support.”
An endpoint can serve ordinary HTTP/3 pages without accepting Extended CONNECT, HTTP Datagrams, or MASQUE protocol tokens. Client and proxy support must be tested separately, and intermediaries may block or reject the required request forms.
Related Articles
- Learn how QUIC and HTTP/3 provide the underlying transport model.
- Compare HTTP/3, HTTP/2, and HTTP/1.1 when choosing an HTTP version.
- See how Oblivious HTTP separates relay and gateway knowledge for a different privacy architecture.
- Review VPN implementation strategies before treating a packet tunnel as a complete remote-access design.
- Understand reverse proxy architecture and how an HTTP proxy differs from a packet-forwarding tunnel.
External Resources
- IETF MASQUE working group
- RFC 9298: Proxying UDP in HTTP
- RFC 9484: Proxying IP in HTTP
- RFC 9114: HTTP/3
- IETF MASQUE working-group repositories
Changelog
- 2026-12-02: First published.

