Reaching into private networks without the networking work

Workers have historically been confined to public endpoints, which kept them from the parts of a stack that matter most: an internal accounts API, an inventory database, a service running in a regional cloud. Workers VPC Services changes that. Once a Cloudflare Tunnel is in place inside the target network, each service you want to expose is registered by its hostname or IP address, and Workers anywhere in the world can call it through an ordinary service binding. Cloudflare's network handles routing to the VPC Service; the Worker's location is irrelevant.

BLOG-2802 Feature Image

The setup: a tunnel, a binding, a deploy-time check

The alternative — VPC peering — means routing tables, security groups and network ACLs, and often weeks of cross-team approvals. Each cloud provider's bespoke "Private Link" offering adds its own lock-in on top. Workers VPC collapses this to two steps: establish the Tunnel once with permissions sufficient to reach the private network, then point a Workers VPC Service at the tunnel plus the hostname (or IP and port) you want to reach. Requests to that VPC Service are routed according to that configuration.

export default {
  async fetch(request, env, ctx) {
    // Perform application logic in Workers here	

    // Call an external API running in a ECS in AWS when needed using the binding
    const response = await env.AWS_VPC_ECS_API.fetch("http://internal-host.com");

    // Additional application logic in Workers
    return new Response();
  },
};

Access is governed by the Workers binding model, not by network-level ACLs. At deploy time, Cloudflare verifies that the Worker is permitted to reach the service in question. At runtime the Worker can talk to that VPC Service and nothing else in the network — the whole network is never exposed.

{
  "type": "http",
  "name": "vpc-service-name",
  "http_port": 80,
  "https_port": 443,
  "host": {
    "hostname": "internally-resolvable-hostname.com",
    "resolver_network": {
      "tunnel_id": "0191dce4-9ab4-7fce-b660-8e5dec5172da"
    }
  }
}

The model earns its keep in two ways. First, it is explicit and auditable: the permission is checked before the code ever runs. Second, it is the same design that makes Workers structurally resistant to Server-Side Request Forgery, which matters more rather than less when the destination is your private network. It also fits what a Worker actually is: not a machine with an IP address living inside a network, but a script on Cloudflare's global network, whose access to anything else in the account is expressed as a binding — VPC Services included.

Tracing a request under the hood

Consider a Worker calling .fetch() on a VPC Service binding with a standard JavaScript Request.

{
  "name": "WORKER-NAME",
  "main": "./src/index.js",
  "vpc_services": [
    {
      "binding": "AWS_VPC2_ECS_API",
      "service_id": "5634563546"
    }
  ]
}

From the Worker to the binding orchestrator. The Workers runtime sends the original HTTP request along with binding context — here, the Service ID — over a Cap'n Proto RPC, the same mechanism used by other Workers bindings. The VPC Service System's Binding Worker receives both and proxies them over an HTTP CONNECT connection to the Iris Service. Keeping the connection logic in Worker code rather than in the runtime is a deliberate, consistent pattern across Cloudflare bindings.

BLOG-3062 Image 1

Iris resolves the destination. Iris is the central service for Workers VPC. It takes the Service ID from the metadata, looks up the associated tunnel's ID and type in the configuration store, then uses Apollo — an internal Cloudflare One service that offers one interface for securely reaching networks and tunnels across networking layers — to get traffic out. Before the HTTP request itself, Iris sends UDP datagrams carrying DNS questions for the service hostname's A and AAAA records. On the first request the path is traversed twice: once for DNS resolution, once for the HTTP request. Later requests reuse Iris's cached DNS information, which keeps latency down.

Apollo picks a datacenter. Apollo takes the tunnel metadata plus the DNS datagrams (or the HTTP request's TCP packets), resolves which datacenter is connected to that tunnel — typically one close to it — and forwards the traffic to the Tunnel Connector Service there.

BLOG-3062 Image 2

The tunnel does the last hop. The Tunnel Connector Service relays the DNS questions and then the request to the tunnel over QUIC. The Cloudflare Tunnel resolves DNS against its local network's resolver and issues the original request from its own IP address to the destination IP and port. Results travel back along the same path, from the datacenter nearest the tunnel to the datacenter executing the Worker.

What this makes buildable

The immediate gain is cross-cloud applications that include Workers but need not replace what runs on AWS, GCP or Azure; stateful backends stay in the network you already trust. During the private beta customers established private connectivity between external clouds and Workers, and Cloudflare has used the same path internally to connect Workers to Kubernetes services in its core datacenters for control-plane APIs.

BLOG-3062 Image 3

On-premise networks are reachable the same way, which gives legacy applications a route to Workers' scale. There is also less conventional usage: developers have run cloudflared on a laptop so a deployed Worker could reach the local machine for real-time debugging. The full flexibility of Cloudflare Tunnels is exposed as a primitive a Worker can program against.

Availability

Workers VPC Services is now in open beta, free to use during the beta period. The closed beta period fed internal team and customer feedback into the product before this milestone, which is the first step toward Workers-to-private-network access.

With the open beta, cross-cloud applications on Workers can reach services on private networks, making those apps available across the globe through Workers.

You can enable Workers VPC Services from the Cloudflare dashboard at dash.cloudflare.com/?to=/:account/workers/vpc/services.