All posts

The Simplest Way to Make Caddy TCP Proxies Work Like They Should

You finally have a sleek microservice stack running. Then someone asks if it can be securely exposed over raw TCP instead of just HTTP. You shrug. Reverse proxies are supposed to make this easy, but most tools choke once you leave port 443 territory. That is where Caddy TCP Proxies earn their keep. Caddy is known for effortless HTTPS, but it quietly packs a flexible proxy layer that works for any TCP or UDP stream. Instead of hacking together stunnel or nginx modules, you can define a Caddy rou

Free White Paper

End-to-End Encryption: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

You finally have a sleek microservice stack running. Then someone asks if it can be securely exposed over raw TCP instead of just HTTP. You shrug. Reverse proxies are supposed to make this easy, but most tools choke once you leave port 443 territory. That is where Caddy TCP Proxies earn their keep.

Caddy is known for effortless HTTPS, but it quietly packs a flexible proxy layer that works for any TCP or UDP stream. Instead of hacking together stunnel or nginx modules, you can define a Caddy route that forwards raw traffic to your upstream. The magic lies in the same configuration logic that powers its HTTP reverse proxy — with automatic TLS, connection reuse, and clean lifecycle control baked in.

Think of it as a transport concierge. Caddy listens on one end, validates and optionally decrypts TLS, then passes the payload through to your backend service. Databases, game servers, MQTT brokers, SSH bastions — anything speaking TCP can ride behind it. With the right automation, you get consistent identity enforcement across all those protocols, not just the ones wrapped in web requests.

How do Caddy TCP Proxies actually work?

At runtime, Caddy routes network traffic using handlers that match incoming connections and forward them to configured destinations. You can define multiple upstreams for load balancing or failover. Because the proxy integrates with Caddy’s TLS stack, certificate management and session resumption come for free.

A few best practices matter here. Enforce identity at the proxy edge using OIDC or short-lived client certificates from an authority like Okta or AWS IAM. Rotate secrets often. Use access logs that record session fingerprints, not just source IPs. When things go wrong, you’ll know who connected and why.

Continue reading? Get the full guide.

End-to-End Encryption: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Real operational benefits include:

  • Reduced configuration sprawl across diverse TCP services.
  • Uniform encryption, regardless of protocol.
  • More predictable failover behavior than manual tunnels.
  • Central visibility into cross-protocol traffic.
  • A cleaner security story for SOC 2 and audit teams.

For developers, Caddy’s proxy model feels like a relief. No more juggling inconsistent firewall rules or separate service meshes just for raw sockets. The workflow becomes faster: define one proxy block, reload, done. Less yak-shaving, more shipping.

Platforms like hoop.dev take this pattern further. Instead of only routing packets, they enforce identity-aware policy automatically. Hoop.dev can treat those TCP targets as protected resources, mapping login context directly to allowed connections. Your ops team sets policies once, and every proxy inherits them without manual updates.

With AI copilots reviewing access patterns, these proxies even start recommending tighter rules. That keeps data exposure under control while freeing humans from repetitive approval tasks.

In short, Caddy TCP Proxies bridge the gap between clever configuration and serious infrastructure hygiene. They turn raw transport flows into something manageable, secure, and fast enough to forget about.

See an Environment Agnostic Identity-Aware Proxy in action with hoop.dev. Deploy it, connect your identity provider, and watch it protect your endpoints everywhere—live in minutes.

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts