Engineering principles

Four rules, each of them adopted after a failure rather than before one.

One core, one branch, four platforms

Every client builds from one branch of one networking core: our modified build of mihomo, an open-source engine we maintain and extend. We adopted the rule after a convenience branch drifted for months and shipped a defect the other platforms had already fixed.

Fail closed, rather than quietly open

Where a misconfiguration could put traffic outside the tunnel, the client refuses to connect rather than appear to work. That check lives in code, not in review.

Test the security assumption; do not inherit it

We checked every endpoint we call, then removed a permissive certificate-handling path that had been kept on belief alone. A test now fails the build if it returns.

Write down the reasoning, including the part that was wrong

Each client and each backend carries a technical document recording why a decision was made, not only what was built. The claims we investigated and disproved are listed there too.

Two problems, and what we did about them

Both write-ups are our own engineering on our own products, not client work, and each one starts with something that was already wrong.

A branch that drifted

The Android build of the networking core sat on its own branch for convenience while the other platforms moved on. Months later it was far behind and still carrying a defect the main line had fixed, so we put every platform back on one branch.

A chain that could have leaked

The macOS client can route its last hop through a proxy the customer supplies. Adversarial review found two ways that could fail without saying so, so the client now refuses to build a configuration it cannot make safe.

What we work in

The languages, databases and services our own software is written in and runs on. This is tooling only: not customers, not partners, not endorsements.

Client applications

  • Swift
  • Kotlin
  • Go

Core and backend

  • Go
  • TypeScript
  • PostgreSQL
  • SQLite
  • Redis

Infrastructure and delivery

  • Cloudflare Workers
  • Cloudflare D1
  • Cloudflare Tunnel
  • Docker
  • GitHub Actions