MASQUE: the IETF protocol for VPN tunnels inside HTTP/3

MASQUE is a family of IETF standards for carrying UDP and whole IP packets inside HTTP, usually HTTP/3 over QUIC. CONNECT-UDP (RFC 9298) turns a web server into a UDP proxy and CONNECT-IP (RFC 9484) into a VPN gateway. Apple's iCloud Private Relay and Cloudflare WARP run on it, and to the network both look like HTTP/3 on UDP port 443.

Updated

On this page

Facts

What it is

IETF standards: UDP and IP tunnels inside HTTP

Since, by

IETF MASQUE working group, 2020; RFCs in 2022 and 2023

Transport

HTTP/3 over QUIC; HTTP/2 over TCP as fallback

Encryption

TLS 1.3 built into QUIC

To the network it looks like

HTTP/3 to the provider's servers

Usual port

UDP 443; TCP 443 for the fallback

Comes as

No link format; URI templates and provider apps

License

Open standard; each implementation has its own license

In Veli

Not supported

Versions and history

  1. 2020

    Working group

    MASQUE, Multiplexed Application Substrate over QUIC Encryption, starts as a BoF in February and is chartered on 14 June 2020.

  2. 2021

    iCloud Private Relay

    Apple's overview of December 2021 says Private Relay proxies traffic with CONNECT and CONNECT-UDP over HTTP/3 and uses HTTP/2 CONNECT where QUIC is blocked.

  3. 2022

    RFC 9297 and RFC 9298

    August 2022: HTTP Datagrams and the Capsule Protocol, and Proxying UDP in HTTP, known as CONNECT-UDP.

  4. 2023

    RFC 9484, CONNECT-IP

    October 2023: whole IP packets over HTTP, so MASQUE can carry a full VPN. Earlier that year iOS 17 let apps and companies configure their own MASQUE relays.

  5. 2024

    WARP for companies

    In March Cloudflare announces MASQUE for its Zero Trust WARP client: TLS 1.3, FIPS-compliant ciphers and port 443 instead of the WireGuard port 2408.

  6. Dec 2024

    Default in 1.1.1.1 & WARP

    The consumer 1.1.1.1 & WARP apps start using MASQUE by default on iOS, Android, macOS, Windows and Linux; WireGuard stays as an option in the tunnel protocol setting.

Three RFCs that make MASQUE

MASQUE is not one wire format like WireGuard but a set of HTTP extensions. Each is a new kind of request, so the same server can serve web pages and tunnels side by side.

  • 9297 (2022)

    NameHTTP Datagrams and the Capsule Protocol

    What it addsUnreliable datagrams tied to a request: QUIC DATAGRAM frames in HTTP/3, capsules on the stream in HTTP/1.1 and HTTP/2

  • 9298 (2022)

    NameProxying UDP in HTTP

    What it addsCONNECT-UDP: the client names a host and port, the proxy relays UDP to it

  • 9484 (2023)

    NameProxying IP in HTTP

    What it addsCONNECT-IP: whole IP packets with address assignment and routes, a VPN

  • TCP: the classic HTTP CONNECT that proxies already use; MASQUE needs nothing new for it.
  • Still in the working group: ECN and DSCP marks for CONNECT-UDP, compression of datagram fields, a proxy mode tuned for QUIC and DNS settings sent in capsules.

How a MASQUE tunnel opens

The client opens QUIC to the proxy on UDP 443 and sends an extended CONNECT request: the method CONNECT, the :protocol pseudo-header set to connect-udp or connect-ip, and a path built from a URI template. The default templates are /.well-known/masque/udp/{target_host}/{target_port}/ and /.well-known/masque/ip/{target}/{ipproto}/. A 2xx answer opens the tunnel; over HTTP/1.1 the same request is an Upgrade and the answer is 101.

Data then flows as HTTP Datagrams. In HTTP/3 each one rides in a QUIC DATAGRAM frame and starts with the request's stream ID divided by four, then a context ID; context 0 means an unchanged UDP payload or a whole IP packet. Lost datagrams are not resent, which is how UDP and IP traffic expect to be treated.

CONNECT-IP also needs addresses and routes, so the two ends exchange capsules on the request stream: ADDRESS_REQUEST, ADDRESS_ASSIGN and ROUTE_ADVERTISEMENT. A router that handles IPv6 must keep the tunnel MTU at 1280 bytes or more.

Where QUIC is blocked, the same requests can go over HTTP/2 on TCP 443, with datagrams sent as DATAGRAM capsules inside the stream. They then arrive reliably and in order, so a lost packet turns into a delay for everything behind it, as in any TCP tunnel. RFC 9297 asks proxies not to convert QUIC datagrams into capsules for that reason.

Who uses MASQUE, and what a client needs

iCloud Private Relay. Safari, DNS lookups and unencrypted app traffic go through two relays run by different companies. Apple's 2021 overview says the relays are checked by a raw public key in the TLS 1.3 handshake, and that devices fall back to HTTP/2 CONNECT where QUIC is blocked. Since iOS 17 apps and companies can also add their own MASQUE relays through NERelayManager, with an HTTP/3 and an HTTP/2 relay URL.

Cloudflare WARP. The 1.1.1.1 & WARP apps have used MASQUE by default since December 2024, and it is also the default tunnel of Cloudflare's Zero Trust client. Cloudflare's docs list UDP 443 for MASQUE and TCP 443 for its HTTP/2 fallback, against UDP 2408 for the WireGuard mode.

Open code. quic-go's masque-go implements CONNECT-UDP under the MIT license. Google's QUICHE library has a MASQUE client and server that its README calls a prototype not ready for production. usque is an independent MIT client for WARP's MASQUE mode, and mihomo has a masque proxy type for WARP-style servers.

There is no common link like vless://: each service keeps its own settings. A WARP-style profile in mihomo shows what a CONNECT-IP client has to know.

  • server, port

    Examplemasque.example.com, 443

    MeaningThe MASQUE endpoint, reached over UDP for HTTP/3

  • private-key

    Examplebase64 ECDSA key

    MeaningThe client's key, registered with the service

  • public-key

    Examplebase64 ECDSA key

    MeaningThe server's key the client expects

  • ip, ipv6

    Example172.16.0.2/32, fd00::2/128

    MeaningThe client's addresses inside the tunnel

  • mtu

    Example1280

    MeaningTunnel MTU; 1280 by default

  • network

    Examplequic or h2

    MeaningHTTP/3, or HTTP/2 over TCP

MASQUE vs WireGuard

The two are compared so often because Cloudflare WARP offers both. WireGuard is one fixed protocol with its own packets and keys; MASQUE runs tunnels inside HTTP/3, so it takes on QUIC, TLS 1.3 and port 443.

Cloudflare gave its reasons for moving WARP to MASQUE in March 2024: its WireGuard port, 2408, is blocked on some public Wi-Fi and ISP networks, WireGuard is hard to extend, and it cannot use FIPS-compliant ciphers.

  • Transport

    WireGuardIts own messages over UDP

    MASQUEHTTP/3 over QUIC; HTTP/2 over TCP as fallback

  • Usual port

    WireGuardChosen by the admin, 51820 by default

    MASQUE443

  • Encryption

    WireGuardNoise IK handshake, ChaCha20-Poly1305

    MASQUETLS 1.3 inside QUIC, FIPS cipher suites possible

  • Where UDP is closed

    WireGuardDoes not connect

    MASQUEFalls back to TCP 443 if the client has the fallback

  • Self-hosting

    WireGuardMany servers and panels

    MASQUELibraries and prototypes

What a censor sees

To a filter MASQUE is QUIC on UDP 443, like any HTTP/3 website, or TLS on TCP 443 after the fallback. Inside the encryption a tunnel request and a page request look alike. The start is not hidden, though: the first QUIC packets are protected with keys anyone can derive from the packet itself, and RFC 9001 says they have no real confidentiality, so the TLS ClientHello and its server name are readable.

Censors use exactly that. Zohaib et al. (USENIX Security 2025) found that the Great Firewall of China decrypts QUIC Initial packets at scale and has blocked QUIC connections to chosen domains since 7 April 2024. Heitmann et al. (FOCI 2026) show that Russia's TSPU blocked international QUIC wholesale in 2022 and switched to blocking QUIC by server name between May 2022 and July 2023. Where QUIC is cut, a MASQUE client works only if it has the HTTP/2 fallback.

The bigger giveaway is the destination. Public MASQUE services belong to a few large providers, and their entry points are published: Cloudflare lists the WARP ingress ranges for firewalls, and Apple tells network admins to block Private Relay by answering no record for mask.icloud.com and mask-h2.icloud.com. MASQUE hides what goes through the tunnel, not the fact that a device talks to WARP or Private Relay.

We found no published study that tells MASQUE traffic apart from ordinary HTTP/3 by its patterns.

Strengths and weaknesses

Strengths

  • Open IETF standards: anyone can build a client or a server
  • Runs on UDP 443 like HTTP/3 websites, not on a VPN port
  • Carries UDP and whole IP packets, many flows in one QUIC connection
  • Can fall back to HTTP/2 on TCP 443 where QUIC is blocked
  • TLS 1.3 with a choice of ciphers, FIPS-compliant ones included

Weaknesses

  • No common link or config format; each service ships its own app
  • Open servers are libraries and prototypes, not a ready self-hosted VPN
  • The first QUIC packet shows the server name; China and Russia filter QUIC by it
  • The big public endpoints are easy to block by IP address or DNS
  • The HTTP/2 fallback turns datagrams into a TCP stream that stalls on loss

Where it works

Programs and servers from our comparison tables that list this protocol.

Clients

  • v2rayN

Servers and panels

  • 3X-UI

Compare these programs

Sources

How we write and check

In Veli

MASQUE in Veli

Veli does not connect MASQUE: neither CONNECT-UDP nor CONNECT-IP.

Veli opens VLESS, VMess, Trojan, Shadowsocks, Hysteria2, TUIC, WireGuard, AmneziaWG and OpenVPN; OpenVPN on Windows and Linux.

Questions

What does MASQUE stand for?

Multiplexed Application Substrate over QUIC Encryption. It names the IETF working group and the protocols it produced: HTTP Datagrams, CONNECT-UDP and CONNECT-IP.

WireGuard vs MASQUE: what is the difference?

WireGuard is its own UDP protocol on a port the admin picks. MASQUE runs tunnels inside HTTP/3 on port 443 with TLS 1.3 and can fall back to TCP, but it has far less open tooling for running your own server.

Does Cloudflare WARP use MASQUE?

Yes. Since December 2024 the 1.1.1.1 & WARP apps use MASQUE by default, and WireGuard stays available in the tunnel protocol setting. It is also the default in Cloudflare's Zero Trust client.

Is iCloud Private Relay a VPN?

Not a full one. It covers Safari, DNS lookups and unencrypted app traffic, sending them through two relays with MASQUE over HTTP/3.

Can I run my own MASQUE server?

Only with developer tools so far: quic-go's masque-go covers CONNECT-UDP, and Google's QUICHE has a prototype server. Apple devices can use your own relay through NERelayManager.