Your container starts fine, traffic flows, but everything breaks when you need to expose a non-HTTP port. Cloud Run looks at you like, “Sorry, we only speak HTTP and HTTPS.” That’s when the question hits: how do you proxy raw TCP to a Cloud Run service without turning your network into spaghetti?
Cloud Run TCP Proxies let you route arbitrary TCP connections—think databases, game servers, SSH bridges—through Cloud Run without hacking around the platform’s HTTP-centric design. Instead of duct-taping a VM or fiddling with reverse tunnels, you place a TCP proxy in front of your service. It receives connections, wraps them with identity-aware access, and forwards them to the right container instance. Elegant. Controlled. SOC 2-approved if you do it right.
The proxy pattern here matters because Cloud Run scales containers based on HTTP requests. For protocols that maintain persistent connections, you need a middle agent to translate behavior. The TCP proxy holds that line. It uses Envoy-style listeners to accept traffic and routes packets through secure tunnels managed by your identity layer—OIDC, Okta, or AWS IAM—so users never see naked ports again. You get ephemeral compute, encrypted sessions, and zero trust automatically applied.
Picture the flow:
- A developer connects from an internal tool or CLI.
- The connection hits a Cloud Run TCP Proxy.
- Authentication validates identity and roles before any packet reaches a container.
- The proxy streams data bi-directionally through Cloud Run’s runtime to your target service.
- Logs, metrics, and access rules get captured per session.
Featured Answer: You can use Cloud Run TCP Proxies to securely expose non-HTTP workloads by deploying a lightweight proxy service that handles authentication and tunnels TCP traffic to your container, providing audit-ready access without custom infrastructure.
Best practices keep this sane: limit concurrent sessions, rotate service accounts often, and treat proxy definitions like infrastructure code. Avoid long-lived credentials; use short-lived tokens from your identity provider. If you cache anything, cache decisions, not secrets.