# Show: clbtransport – Drop-in Go http.Transport wrapper to prevent connection pinning

**URL:** <https://forum.golangbridge.org/t/show-clbtransport-drop-in-go-http-transport-wrapper-to-prevent-connection-pinning/42444>\
**Category:** Releases\
**Created:** [August 28, 2026, 4:44am UTC](https://forum.golangbridge.org/t/show-clbtransport-drop-in-go-http-transport-wrapper-to-prevent-connection-pinning/42444 "2026-08-28T04:44:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roy2220](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/roy2220/32/17855_2.png) [@roy2220](https://forum.golangbridge.org/u/roy2220)\
**Post date:** [August 28, 2026, 4:44am UTC](https://forum.golangbridge.org/t/show-clbtransport-drop-in-go-http-transport-wrapper-to-prevent-connection-pinning/42444/1 "2026-08-28T04:44:32Z")

</div>

**Repo** : [https://github.com/roy2220/clbtransport](https://github.com/roy2220/clbtransport)

Kubernetes is the standard infra for cloud-native workloads today, and most backend developers eventually hit the same wall: calling another service through its Kubernetes Service DNS name over plain HTTP leads to uneven load across backend pods.

The usual fixes people reach for are:

- The Kubernetes Endpoints API
- A gateway / load balancer
- A service mesh

But does it really have to be this heavy?

# Rethinking load balancing

Think about the ideal case: if every single request picked a target node at random from the whole pool right before sending, the cluster load would end up balanced (assuming all nodes are roughly equal in capacity).

Short-lived HTTP connections combined with disabled DNS caching get you exactly that — but at a cost nobody wants to pay: every request now pays for a DNS lookup, a TCP handshake, and a TCP teardown.

So long-lived (keep-alive) connections are non-negotiable. The real problem becomes controlling _how often_ a request gets to re-pick its target node:

- Too rare, and traffic piles up on whichever node was picked first.
- Too frequent, and the cost of constantly re-establishing TCP connections eats the balancing benefit.

# The approach

`clbtransport` controls that frequency along two axes:

1. **Bound connection lifetime.** Long-lived connections aren’t allowed to live forever — after some time (with jitter, to avoid synchronized reconnects) they’re retired, giving requests a fresh chance to land on a different node.
2. **Spread connections per host.** Since connection lifetime can’t be pushed arbitrarily low without hurting latency/SLA (TCP setup blocks the request), a small number of independent connections are kept “hot” per host in parallel, multiplying the opportunities for requests to fan out across nodes.

The result behaves like a standard `http.RoundTripper` — a drop-in replacement for `http.Transport` — that quietly rebalances traffic in the background instead of relying on cluster-side machinery.
