Skip to content

About

An open source, self-hosted implementation of the Tailscale control server, with VLESS protocol support

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

180 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StealthScale

A self-hosted, stealthy mesh — one binary that is both the client and the coordinator — using VLESS + Reality (xtls/reality) + uTLS so all traffic is indistinguishable from ordinary TLS to a network observer (the server steals the decoy site's real handshake).

No Tailscale compatibility layer — StealthScale is not intended to be compatible with stock Tailscale clients, servers, or Headscale. WireGuard is fully replaced by VLESS+Reality; there is no compatibility mode.

StealthScale is a fork of Headscale with a different end goal: there is no "head" server and no special client. Every device runs the same binary, becomes a node in the network, and coordinates with its peers. An always-on coordinate server is encouraged for reliability, but any node can become a coordinate server by default — there is no privileged role. The wire protocol is replaced with VLESS + Reality (github.com/xtls/reality, MPL-2.0) + uTLS so node-to-node and node-to-coordinator traffic is not recognisable as Tailscale/Headscale.

See docs/stealthscale/overview.md for the project goals and current status.

Why

WireGuard handshakes and endpoints are fingerprintable, which makes a self-hosted tailnet easy to spot and block on monitored networks. StealthScale replaces the data path with a per-node VLESS endpoint behind XRay, shaped with uTLS ClientHello fingerprinting. Node traffic looks like ordinary TLS to a network observer.

How it works

┌─────────────────────────────────────────────────────────────────────────┐
│  stscale — one binary, every device is a node                           │
│                                                                         │
│  ┌─────────────────────────┐  VLESS + Reality + uTLS  ┌────────────────┐ │
│  │  coordination (embedded)│◄────────────────────────►│ coordination   │ │
│  │  API · policy · IPAM    │     stealth control      │ (peer, any     │ │
│  └────────────┬────────────┘                          │  node can be   │ │
│               │ this node is also a peer              │  coordinator)  │ │
│               └───────────────────────────────────────┴────────────────┘ │
│                                                                         │
│  data plane:  node ◄──────── VLESS stealth (noise inside) ────────► node │
│                                                                         │
│  any node may coordinate — no privileged role, always-on coordinator    │
│  is recommended for reliability.                                        │
└─────────────────────────────────────────────────────────────────────────┘

Every device runs the same binary. Each is a node. Any node may act as the coordinator (on by default); the others treat it as the source of truth but still coordinate directly with each other. There is no separate "headscale" server.

  • Every registered node gets its own VLESS listener: a deterministic port and UUID derived from its node ID (UUIDv5("stealthscale:<id>") and sha256("stealthscale-port:<id>") mapped into the configured range).
  • The UUID/port never change across restarts, enabling static client config.
  • The standard Tailscale noise handshake and HTTP/2 machine API run inside the authenticated VLESS stream.

See docs/stealthscale/overview.md for the full architecture.

Compatibility

Caution

No Tailscale compatibility — StealthScale has no compatibility layer and is not intended to be compatible with stock Tailscale clients, Tailscale control servers, or Headscale. WireGuard is fully replaced by Xray/VLESS+Reality; there is no fallback or translation mode. Do not attempt to connect stock tailscale binaries.

You need:

  • Server: this repository (built as stscale). It exposes its own management API and VLESS endpoints — not the Headscale/Tailscale API surface.
  • Client: the unified stscale binary in up mode (stscale up --node-id <id>, or --vless-uri ...) — see docs/stealthscale/clients.md. A separate patched Tailscale client is not supported.

Quick start

1. Build

make build     # produces ./stscale

2. Configure

cp config-example.yaml /etc/stealthscale/config.yaml
# set server_url, then enable the VLESS transport (reality_xtls is the default):
#   xray:
#     enabled: true
#     security: reality_xtls
#     listen_port: 10001
#     max_listen_port: 10100

3. Run

stscale serve --config /etc/stealthscale/config.yaml
curl -s https://ctl.example.com/health
curl http://127.0.0.1:8080/web   # embedded WebUI (also at /admin)

4. Create a user and pre-auth key

stscale users create alice
stscale preauthkeys create --user <user-id> --reusable

5. Run another device as a node

There is no special client. Run the same binary on any device; it becomes a node and can act as the coordinator by default:

stscale serve --config /etc/stealthscale/config.yaml

To join an existing network, point it at a coordinator and (if needed) a pre-auth key. The endpoint is fetched from the coordinator — no URI copy/paste:

stscale up \
  --coordinator https://ctl.example.com \
  --authkey <pre-auth-key> \
  --node-id 1

Without a pre-auth key, drop --authkey: stscale up prints a registration URL and the join completes in the same command once you approve it there.

The vless:// URI for a node can also be printed on the coordinator (with stscale nodes vless <node-id>) and passed via --vless-uri — see docs/stealthscale/clients.md.

Discovery vs stealth: finding a coordinator for the first time may use whatever is necessary (including non-stealth discovery). But once two peers have identified each other, all further transport is VLESS stealth — the control path runs inside the stealth stream rather than as a plaintext port. Stealth uses uTLS-shaped TLS with a decoy certificate; the client validates the server via its Reality public key (not the certificate). Full XTLS-Reality replay of a real destination's certificate is a planned enhancement.

Web UI — the control plane

StealthScale ships an embedded Web UI (at /web and /admin) that is the primary management surface. It is not a read-only dashboard: every configurable aspect of the network — nodes, users, pre-auth keys, tags, policy (HuJSON), DERP, VLESS endpoints, and coordinator election — must be configurable from it.

We treat headscale-ui and the Headscale Web UI reference as design guidelines and improve on them: the StealthScale UI talks to the live control plane, is embedded in the binary, and must expose full write operations. The current embedded UI is read-only (see docs/stealthscale/overview.md → Current status); closing that gap is a core goal.

Development

Requires Go 1.26.1+. The repo ships a Nix dev shell and pre-commit hooks via prek (see AGENTS.md).

make dev          # fmt + lint + test + build
make build        # build ./stscale
make test         # go test ./...

Server-level tests live in hscontrol/servertest/ and include an end-to-end VLESS test (hscontrol/servertest/xray_vless_test.go) that drives the protocol with a raw VLESS client.

Documentation

The full docs live in docs/ (MkDocs):

License

BSD-3-Clause for StealthScale-originated code. See LICENSE.

This project bundles third-party components under their own licences (see LICENSE → Third-Party Licenses):

  • github.com/xtls/reality — MPL-2.0 (Copyright (c) 2023 RPRX) — XTLS-Reality server.
  • github.com/XTLS/Xray-core (reality transport) — MPL-2.0 — reference for the lightweight Reality client port (hscontrol/xray/reality_client.go).
  • github.com/refraction-networking/utls — BSD-3-Clause — uTLS fingerprinting.

StealthScale is a modified version of Headscale; it is not endorsed by the original Headscale maintainers.

About

An open source, self-hosted implementation of the Tailscale control server, with VLESS protocol support

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages