The Simplest Way to Make Civo and Tcp Proxies Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using civo and tcp proxies together lets teams route raw network traffic into cloud clusters. This setup directs external packets to internal services while keeping private nodes off the public internet. Teams run workloads on Civo to get fast Kubernetes clusters and simple virtual machines. Those apps often use raw TCP protocols for databases, message queues, and custom backend tools. Standard web routers only handle HTTP traffic and fail to forward raw byte streams. Adding a TCP router solves

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Using civo and tcp proxies together lets teams route raw network traffic into cloud clusters. This setup directs external packets to internal services while keeping private nodes off the public internet.

Teams run workloads on Civo to get fast Kubernetes clusters and simple virtual machines. Those apps often use raw TCP protocols for databases, message queues, and custom backend tools. Standard web routers only handle HTTP traffic and fail to forward raw byte streams. Adding a TCP router solves this problem by accepting connections on specific ports and forwarding packets.

How data and permissions flow across civo and tcp proxies

A request starts when a client app opens a socket to a public IP address. Civo provides this public address through an external load balancer or a reserved node IP. The firewall checks the source address and target port against the active security rules. If the rule allows the packet, the network forwards the stream to the TCP forwarder.

The forwarder reads the target port and looks up the matching backend service inside Civo. It opens a new socket to the private IP address of the target pod or instance. Bytes then flow back and forth between the client and the backend service over this path.

Identity checks and encryption happen at two places in this flow. The TCP forwarder can terminate TLS and check client certificates before passing traffic further inside. Otherwise, the forwarder passes encrypted bytes straight through, and the backend database checks the user login.

Common failure modes and how to scope network paths

Many teams expose broad port ranges on their Civo firewall to save time during setup. This mistake lets anyone on the internet probe internal ports and test weak passwords. Another common problem happens when teams share a single database login across all developer laptops.

When everyone uses the same key, audit logs cannot show which person ran a bad query. Shared keys also force teams to update every app when one person leaves the company. Unlogged TCP streams make the problem worse because raw byte forwarding leaves no query history.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix the network layer by locking down Civo firewall rules to strict source IPs. Only allow ingress traffic on the exact ports your TCP router needs to accept connections. Place all backend databases and message brokers on a private Civo network with no public IPs.

Next, create separate roles and logins on each backend service for every app and team. Give read-only roles to users who only need to check data for daily support tasks. Reserve write roles for automated deployment tools and specific admin tasks that require changes.

How to keep raw TCP connections fast and stable

Raw TCP streams keeps the session active much longer than normal web requests. Long connections can drop if the Civo load balancer closes idle sockets too soon. Teams must match the idle timeout settings on both the cloud balancer and the TCP router.

Health checks also matter for keeping traffic moving to healthy nodes. Set up the TCP router to ping backend ports every few seconds. If a node fails to reply, the router stops sending new connections to that dead address. This simple check prevents apps from hanging when a Civo node restarts during an update.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can a Civo load balancer route raw TCP traffic on its own?

Yes, a Civo load balancer can forward raw TCP ports to cluster nodes. Teams add dedicated TCP routers when they need finer port mapping or custom routing rules.

Why do database connections drop through a TCP router on Civo?

Drops happen when the router or cloud firewall closes an idle socket after a quiet period. Turning on TCP keepalive messages in your client app stops the network from dropping idle sessions.

How do we restrict who can reach our TCP ports on Civo?

Use Civo firewall rules to block public traffic and allow only known office or VPN addresses. Pair network rules with unique user accounts and strong TLS certificates on the backend service.

The query runs. The emails stay hidden.