Skip to content

Your Backend Knows Too Much: What Cloudflare's New OHTTP Gateway Actually Changes

Every request your server receives arrives with a small dossier attached. An IP address. An ASN. A TLS version and cipher list that's often unique enough to tell one device from another.

Technology AI 14 min read Add as preferred source

You didn’t ask for any of it. You still have to store it, secure it, disclose it in a privacy policy, and answer for it when someone asks what you do with it.

For most apps that’s a fair trade. For some it’s a liability you’d happily hand back, if there were a way to do that without building a Tor-sized system. That’s the gap Oblivious HTTP (OHTTP) fills, and on October 2, 2026, Cloudflare announced a product that removes the most annoying piece of running it: the gateway.

This article is about what OHTTP is, why Cloudflare’s gateway matters, how to wire the pieces together, and the parts that no gateway, Cloudflare’s or anyone else’s, can fix for you. I read the announcement and RFC 9458 end to end before writing this. Anything I couldn’t confirm from those two sources is marked [VERIFY].

A normal HTTPS request has one hop of trust. The server sees who you are (IP, fingerprint) and what you asked for (path, body). Put a VPN or a plain proxy in the middle and you’ve just moved the problem: now the proxy sees both.

OHTTP splits the knowledge between two parties who aren’t supposed to be the same company. The first is the relay. It sees your IP address and the fact that you sent something, but the something is ciphertext. The second is the gateway. It can decrypt the request, so it sees the content, but the only network peer it ever talks to is the relay. It never learns your IP.

Cloudflare’s own announcement calls this a double-blind model, and the phrase is accurate. The relay sees client identifiers and nothing else. The gateway and the app server see request contents and nothing else. No single party holds both halves.

Here’s what your app server sees without OHTTP, from Cloudflare’s example: the client’s real IP, its ASN, its TLS cipher, its country, region and city. With OHTTP, the same server sees the relay’s IP, the relay’s ASN, the relay’s cipher suite, and the relay’s location. Thousands of users look identical, and that’s the point. The privacy comes partly from encryption and partly from crowd size.

The RFC is blunt about when this is worth the trouble. OHTTP only helps where requests don’t carry state between them. Cookies, session tokens, and logins all link requests back together at the application layer, which makes the transport-layer unlinking pointless. The RFC’s own examples of good fits are DNS queries, telemetry submission, anonymous surveys, search queries, and fetching location-specific content like map tiles. Cloudflare’s examples are consistent with that: Flo Health’s Anonymous Mode, and Apple’s Private Cloud Compute, which uses OHTTP to separate AI inference requests from user identities.

If your app is a logged-in dashboard, close this tab. OHTTP isn’t for you, and I’ll say more about why later.

You don’t need to implement the crypto to use this, but you should know what’s in the envelope, because it explains most of the operational rules.

The client builds a normal HTTP request, then serializes it into Binary HTTP (RFC 9292). It then encrypts that blob with HPKE (RFC 9180) against the gateway’s public key. The result is an Encapsulated Request with the media type message/ohttp-req. The client POSTs that to the relay. The relay forwards the same bytes to the gateway. The gateway decrypts, makes the inner request to the target, encrypts the answer, and sends it back as message/ohttp-res. The relay passes it along.

The RFC’s pseudocode for the client side is short enough to read in one breath.

hdr = concat(encode(1, key_id),
encode(2, kem_id),
encode(2, kdf_id),
encode(2, aead_id))
info = concat(encode_str("message/bhttp request"),
encode(1, 0),
hdr)
enc, sctxt = SetupBaseS(pkR, info)
ct = sctxt.Seal("", request)
enc_request = concat(hdr, enc, ct)

Two details matter for everything that follows. First, the client generates a fresh HPKE context for every request, so there’s no session for anyone to correlate. Second, the gateway publishes its public keys as a key configuration, served as application/ohttp-keys: a key ID, a KEM, the public key, and the supported KDF/AEAD pairs. Clients need that configuration to be authenticated, because if an attacker swaps it, they can read your traffic.

Notice what the gateway sends back on success: always a plain HTTP 200 wrapping the encapsulated response. Errors that happen after decryption are encrypted too. Errors before decryption, like an unknown key ID, travel unencrypted, which is why an outdated key config can look like a mysterious failure on the client.

Cloudflare has been in the OHTTP business since 2022, when it launched what it called Privacy Gateway. Despite the name, that was a relay. Customers brought their own gateway, which means running your own HPKE key management, your own decryption service, and your own scaling story, all on a latency budget that already has an extra hop in it.

Cloudflare says that burden is the problem. In the announcement they describe how hard it is for customers to build and operate a secure, fast OHTTP gateway at scale, and they’re launching a closed beta of a self-serve Cloudflare OHTTP Gateway. The old product is being renamed Cloudflare OHTTP Relay, so the two names don’t collide.

There’s a second reason, and it’s the more interesting one. If your servers already sit behind Cloudflare (the CDN, Workers, anything proxied), you couldn’t use Cloudflare’s relay at all. The relay would see your clients’ IPs, and Cloudflare, as your CDN, would also see the decrypted contents. That collapses the separation OHTTP exists to create. So a large share of Cloudflare’s own customers were locked out of Cloudflare’s own privacy product by the protocol’s trust model. The gateway fixes that: put the gateway at Cloudflare, bring a relay from someone else, and the halves stay apart.

Which should you pick? Cloudflare gives a decent rule of thumb. If your app servers live off Cloudflare and you’re happy running your own gateway, use their Relay. If your servers are behind Cloudflare, if you want to accept OHTTP traffic from a third party (their example is Apple’s Live Caller ID lookup), or if you just want a managed gateway with less latency and less operational weight, use the Gateway with a relay from somebody else.

The design is more opinionated than I expected, and I mean that as a compliment.

The gateway is a feature of your zone. You enable it, and clients send OHTTP requests to https://your-zone.com/.well-known/ohttp-gateway. The same path answers GET requests with the public key configuration, and Cloudflare manages the keys for you entirely. Non-OHTTP requests go to your origin as they always did, without touching the gateway. So you can adopt OHTTP for one endpoint without rebuilding anything else.

Cloudflare supports both standard OHTTP and chunked OHTTP, and recommends chunked for performance because it lets the service process requests incrementally. One thing to keep straight: chunked OHTTP is an IETF draft (Cloudflare links draft-ietf-ohai-chunked-ohttp-08), not a finished RFC. Standard OHTTP is RFC 9458, published in January 2024 by Martin Thomson of Mozilla and Christopher Wood of Cloudflare. That’s useful context for later, when we get to the standards risk.

Abuse is handled by binding the gateway to your zone. A client talking to example.com can reach foo.example.com or bar.example.com, but it can’t use your gateway as a stepping stone to some unrelated domain. The RFC says gateways should have an allowlist so they aren’t turned into open proxies, and this is Cloudflare doing that for you by default.

The part I find most interesting is relay authentication. The gateway knows almost nothing about a client, by design, so it has to trust the relay to behave. Cloudflare runs Access before decryption. That means you can reuse ordinary Access policies to decide which relays may talk to your gateway, including mutual TLS, static service credentials, or custom external logic. Pre-decryption matters: you reject unwanted traffic before spending CPU on HPKE.

And then there’s the guardrail. Cloudflare expects some customers to accidentally run both relay and gateway on Cloudflare, so the gateway will refuse to decrypt requests that come from Cloudflare Workers or from proxied hosts on Cloudflare. A vendor shipping a product that blocks its own customers from a configuration that would’ve been easy to monetize deserves a note. It’s enforcing the privacy model in code.

For performance, Cloudflare’s claim is that anycast lets the gateway run on every server in its edge network, so the relay-to-gateway hop stays short. If your origin also sits behind their CDN, they say decrypted requests can be resolved on the same machines, which saves the gateway-to-origin trip. That’s their claim, and the announcement doesn’t publish benchmarks. I’m not going to repeat numbers that don’t exist.

Here’s the shape of a full deployment. You’ll need three things: a client that speaks OHTTP, a relay run by someone who isn’t you (or at least isn’t your gateway’s operator), and an app behind the gateway that’s written knowing it’ll see an anonymized stream.

Start by looking at the key configuration. This is what a client fetches once and caches.

Terminal window
curl -sS -D - https://api.example.com/.well-known/ohttp-gateway -o keys.bin

You should get an application/ohttp-keys blob back. [VERIFY: exact response headers and key rotation behavior in the closed beta.] One privacy wrinkle from Cloudflare’s own guidance: fetch the keys over a different IP than the one you use for gateway requests, otherwise you’ve handed the gateway a link between your address and your later traffic.

The client side. I’m keeping the OHTTP library calls abstract, because the library landscape is moving and I won’t invent an API for you. Cloudflare points to ohttp.info and its sample client library as starting points. [VERIFY: which library you pick and its current function names.]

client.ts
// encapsulate / decapsulate come from whichever OHTTP library you choose.
import { encapsulate, decapsulate } from "./ohttp";
const RELAY_URL = "https://relay.example.net/ohttp";
export async function sendPrivately(keyConfig: Uint8Array, payload: unknown) {
// The inner request is a normal HTTP request for the *target*.
const inner = new Request("https://api.example.com/events", {
method: "POST",
headers: {
"content-type": "application/json",
date: new Date().toUTCString(), // RFC 9458 recommends sending Date for anti-replay
},
body: JSON.stringify(payload),
});
// Serialize to Binary HTTP, then HPKE-seal against the gateway's key.
const { bytes, context } = await encapsulate(keyConfig, inner);
const res = await fetch(RELAY_URL, {
method: "POST",
headers: { "content-type": "message/ohttp-req" },
body: bytes,
});
// Anything that isn't an encapsulated response is a signal, not data.
// Most often it means your cached key config is stale: refetch it.
if (res.status !== 200 || res.headers.get("content-type") !== "message/ohttp-res") {
throw new Error(`gateway rejected request (HTTP ${res.status}); refresh key config`);
}
return decapsulate(context, new Uint8Array(await res.arrayBuffer()));
}

Now the relay. Cloudflare says relays are simple and can run on any provider, and points at thibmeu/ohttp-relay as sample code. Here’s a minimal one in Hono on Bun, because that’s an easy stack to run on a plain VPS. Note where it can’t run: not on Workers, and not on a Cloudflare-proxied host. The Gateway will refuse those by design.

relay.ts
// run on non-Cloudflare infrastructure. Illustrative, not production-hardened.
import { Hono } from "hono";
const GATEWAY = "https://api.example.com/.well-known/ohttp-gateway";
const app = new Hono();
app.post("/ohttp", async (c) => {
if (c.req.header("content-type") !== "message/ohttp-req") {
return c.text("unsupported media type", 415);
}
const upstream = await fetch(GATEWAY, {
method: "POST",
// Only what the gateway needs. Never forward the client's other headers,
// and never add Forwarded / X-Forwarded-For / Via.
headers: {
"content-type": "message/ohttp-req",
// Relay auth for the gateway's Access policy. [VERIFY: which Access
// method the beta gateway accepts: mTLS, service token, or other.]
"cf-access-client-id": process.env.ACCESS_CLIENT_ID!,
"cf-access-client-secret": process.env.ACCESS_CLIENT_SECRET!,
},
body: await c.req.arrayBuffer(),
});
return new Response(upstream.body, {
status: upstream.status,
headers: {
"content-type": upstream.headers.get("content-type") ?? "application/octet-stream",
"cache-control": "private, no-store",
},
});
});
export default { port: 8787, fetch: app.fetch };

Finally, the app behind the gateway. To your handler this is just a POST. That’s the whole selling point. But a good OHTTP target is written differently from a normal one, and the difference is replays.

worker.ts
// the app behind the gateway (Hono + Drizzle on Workers/D1)
import { Hono } from "hono";
import { drizzle } from "drizzle-orm/d1";
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
const events = sqliteTable("events", {
id: text("id").primaryKey(), // client-generated random ID, one per event
name: text("name").notNull(),
receivedAt: integer("received_at").notNull(),
});
const app = new Hono<{ Bindings: { DB: D1Database } }>();
app.post("/events", async (c) => {
const { id, name } = await c.req.json<{ id: string; name: string }>();
// A relay (or a network attacker) can replay an encapsulated request.
// A replay decrypts to the same body, so the same id. Insert once, ignore the rest.
await drizzle(c.env.DB)
.insert(events)
.values({ id, name, receivedAt: Date.now() })
.onConflictDoNothing();
return c.json({ ok: true }, 202);
});
export default app;

I left validation out to keep the example short. Add it. And don’t put anything in that body that identifies the person, which brings us to the part that trips people up.

Cloudflare’s own getting-started notes say it plainly, and I’d tape this above my monitor: OHTTP provides privacy at the network level and doesn’t touch the inner request body. If your client sends an email address, a username, a device ID, or an auth token inside the encrypted request, you’ve built an expensive way to send that identifier privately to the one party you were trying to hide it from. The relay can’t see it. The gateway and your app can. Network anonymity ends where your payload begins.

Then there’s the relay, which is a trust problem, not a cryptography problem. Cloudflare says it directly: the reason you might want a dedicated relay provider is to be able to verifiably promise your users that no one inspects logs with client identifiers. If you run both the relay and the gateway, or if they collude, they correlate client IPs with decrypted requests and the whole thing is theater. The RFC states the requirement outright: the relay and gateway can’t be operated by the same entity. Nothing in the protocol can verify that; it’s an organizational promise, and your users have to take your word or a third party’s.

Replays are your job. The RFC puts the responsibility on the application: a relay can copy and resend an encapsulated request, and so can a network attacker if the client used TLS early data. The RFC suggests using the encapsulated key material as a unique identifier and recommends clients send a Date header, so the server can keep a short time window and reject stale or repeated requests. The idempotent insert above is the simplest defense I know. Whether Cloudflare’s gateway applies any replay window on your behalf isn’t covered in the announcement. [VERIFY: ask in the beta.]

Traffic analysis is also still on the table. Timing and size can still link a request on one side of the relay to a request on the other, especially at low volume. Padding helps, and Binary HTTP supports it, but a quiet relay with ten users is a weak relay no matter how good the crypto is.

Finally, anonymity sets shrink when configurations multiply. Every distinct combination of relay, gateway URI, and key config partitions your user base. The RFC warns that unique client configurations can be used to track individuals, and that client privacy depends on each configuration being shared by many others. If you ship ten app versions with ten different key configs, you’ve cut your crowd into ten.

This is a closed beta. Customers register through a waitlist form, and the announcement says it’ll be a paid add-on to a zone this fall. I couldn’t find published pricing, rate limits, or availability by plan, so I won’t guess. [VERIFY: pricing, limits, and which plans can enable it.]

You still bring your own relay. That’s a feature when it comes to trust separation and a chore when it comes to shipping. If you don’t have a relay provider you trust, you’ve solved the gateway problem and kept the harder one.

The protocol has real limits too. The RFC’s design assumes a fixed one-to-one mapping between a relay and a gateway, so you don’t get a pool of anonymous relays unless you build that distribution yourself. Responses can’t be processed progressively under the base spec, since the AEAD wrapper can’t be removed until the whole message arrives, which is presumably why chunked OHTTP exists. Clients can’t use Expect: 100-continue. Anything built on certificate pinning to the target doesn’t work, because the client never connects to the target. And corporate TLS-interception setups may break it, a point the RFC itself raises.

Last, a point I’d rather say than leave for you to find: a managed gateway concentrates trust in the vendor’s code. You hand Cloudflare the HPKE private key lifecycle. For most teams that’s a good trade against hand-rolling it. If your threat model includes the infrastructure vendor, think about whether a gateway on someone else’s hardware is acceptable.

I think the interesting story isn’t OHTTP. It’s the packaging.

Network privacy used to be something users were told to do for themselves: install a VPN, block cookies, add an extension. Cloudflare’s announcement opens with that complaint, that users carry too much of the burden, and I agree with it. The deeper shift is putting the privacy boundary on the server side, as something developers adopt like they adopted HTTPS. Nobody hand-rolls TLS termination anymore. A hand-rolled HPKE gateway is the same kind of mistake waiting to happen.

The protocols themselves have existed for years: HPKE in 2022, OHTTP in 2024, the Privacy Pass family alongside. What was missing was a version a small team can switch on in a dashboard. That’s what turns a standard from something described in an RFC into something that shows up in production. DoH became real when browsers and big resolvers shipped it, not when the RFC was published.

There’s a tension I don’t want to hide. The cleanest privacy infrastructure tends to concentrate in a handful of big network operators, because relays only work well with volume and neutrality. I’d like a world with many independent relays. I suspect we’ll get a few. That isn’t a reason not to use OHTTP, since it’s still strictly better than a single hop that sees everything. It’s a reason to keep asking who runs the relay.

This is for you if you build an app that submits sensitive but stateless requests: health or wellness data, telemetry, lookups, search, anonymous feedback, AI inference where you’d rather not tie prompts to identities. It’s especially for you if your servers already sit behind Cloudflare and the Relay was never an option.

Skip it if your users log in and every request carries a session, if you have no relay operator you can honestly call independent, or if you can’t guarantee that the payload stays free of identifiers. In those cases OHTTP gives you a feeling of privacy and little else, and the fix is a design change, not another proxy.

The best privacy feature in any system is data you never had to hold, and this is the first time that’s been a dashboard toggle instead of a research project.

  • Confirm the endpoint is genuinely stateless: no cookies, tokens, or login on OHTTP routes

  • Strip identifiers from the inner request body (email, username, device ID, auth headers)

  • Join the Cloudflare OHTTP Gateway waitlist and get pricing and limits in writing [VERIFY]

  • Choose a relay operator that isn’t you, isn’t Cloudflare-hosted, and will commit to not logging client identifiers

  • Set an Access policy so only your relay can reach the gateway (mTLS or service credentials)

  • Fetch key configs over a separate path from request traffic, cache them, and refetch on unencrypted 4xx responses

  • Send a Date header from the client and make the target idempotent so replays are harmless

  • Keep the number of active key configurations and relays small to protect the anonymity set

  • Test end to end with Cloudflare’s pvcli client before launch

You're offline Check your connection.