Plexus VPN is a network service integrated with the Plexus Messenger ecosystem. It combines account-based access management, stable subscription links with dynamically generated responses, traffic accounting, quotas and connection-parameter lifecycle management.
The system separates the control plane, which makes access and configuration decisions, from the network components that carry user traffic. This case study covers the architecture, the engineering decisions and the lessons learned from operating the system as it evolved.
Plexus VPN is not a set of static configs but a service tied to the messenger's account and permission system. Once granted the permission, a user creates connections in settings — up to eight separate configurations per account — and gets a subscription link for each: a stable URL the client application periodically polls for the current set of routes. VPN management is decoupled from messaging: the network plane needs no access to message contents.
subscription-userinfo header carries quota usage — it is
also visible in VPN settings. Three formats: a universal set of
vless:// links, a full JSON config on request
and an HTML deep-link redirect; the backend can serve the v2rayNG
installer through its own endpoint for networks without GitHub access.vless:// link cannot carry rules, so clients that import
only individual links get no bypass.Some users sit behind networks with active filtering, and the restrictions there hit different layers: destination address (blocks and connection “freezes” toward foreign hosting IPs), TLS metadata (an SNI name not matching the address's network segment), transport characteristics (WireGuard/OpenVPN/AmneziaWG protocol signatures) and connection behavior. Not every provider applies all of these mechanisms — but the architecture had to withstand each one actually observed in the networks in use; this is not a description of all networks and operators at once.
Hence the system requirements:
Control plane — the authoritative VPN state: account binding, permission checks, peers, quotas, the desired configuration. Decisions are made by plexus-core (its database holds the desired and authoritative state — the single source of truth on rights, peers and quotas) and applied by plexus-vpn — a separate executor service with no authoritative user-state store of its own. Data plane accepts connections, runs user sessions and forwards traffic over the configured routes: the nginx SNI router, the Xray network engine, the Caddy HTTP front and the RU L4 relay.
Terms: a peer is an internal access record bound to an account and a set of connection parameters; it is not necessarily a separate device. An inbound is an ingress profile accepting VPN connections in Xray (each with its own transport and decoy domain). A peer is registered on all current inbounds at once — one key, several ways in. Web ingress and the VLESS inbounds share the Hetzner host's single external TCP/443 (the ss-fallback and AWG ports are separate) — the messenger site lives on it too. nginx reads only the SNI in ClientHello and decides at the transport layer who gets the connection: decoy-domain names go to Xray, everything else to Caddy, which serves the web and API. On the VLESS/REALITY path neither of them terminates client TLS.
plexus-vpn is better described not as a “stateless executor” but as a VPN configuration worker: the source of truth is the core database; the service itself stores only the list of issued uuids and applies decisions via the Xray API (the api inbound is reachable only inside the isolated docker network). After a restart the worker does not restore “its own” state — periodic reconciliation compares the key set on the gateway with the database and brings it into line; operations are designed idempotent: a repeated reconcile should converge the gateway to the same state, not multiply entities (actual behavior depends on the operation result and on Xray API error handling).
The plexus-vpn internal token is limited to the VPN namespace and does not open the messaging API. Its compromise still leaves risks around VPN access and configuration management — but it is not a universal messenger credential.
Access moves through four states: creation (mint), periodic reconciliation with the database (reconcile), rotation (rotate) and revocation (revoke). Two different objects matter here. Subscription URL — a stable subscription link with a random token: the token is per-peer and is itself an access secret. Connection credentials — the parameters of a specific connection inside the subscription response (uuid, REALITY keys, short ID, SNI, fingerprint): they change on rotation and die on revocation, while the link outlives any key. The subscription re-reads the account's current rights on every request — lose the permission and the route disappears at the client's next refresh.
The VPN permission and acceptance of the terms of use are checked (AUP acceptance is recorded as a flag on the row). The core asks plexus-vpn for a new key; it registers the uuid on all current inbounds via the Xray API. Limit — 8 configurations per account. The row gets its subscription token at birth.
Every 5 minutes the key set on the gateway is compared with the database: missing keys are restored, orphans are removed, traffic counters are read into quotas. Operations are idempotent — but the sweep runs on both core nodes in parallel, with no leader lock (see the roadmap section).
An epoch is an internal version of the configuration generation in code: bumping it initiates a controlled rotation — the sweep reissues rows on the old epoch. Order matters: the old key's counter is read first, then a new uuid is created and only then is the old one removed; a failure between steps is corrected by the next reconcile. The quota is not reset and the subscription link does not change.
Synchronous: the key is removed from the gateway at call time, the row is marked dead (“not found on gateway” is also a terminal state). In the current implementation the subscription immediately answers 404; new connections are rejected — already-open sessions are not forcibly torn down by a normal delete. Rows and counters are kept — for audit and monthly accounting.
The diagram is a state model, not a strictly linear pipeline: reconcile runs on a schedule for all live rows, while rotation and revocation are triggered by different events at different points in a configuration's life.
Four different mechanisms with different triggers and different recovery paths — worth telling apart.
The primary transport is VLESS + REALITY. The functions are worth separating: VLESS is the user-session protocol; REALITY is the connection-establishment mechanism that uses the parameters of a configured target TLS server (the decoy domain) and performs its own key-material check of the client; access issuance, keys and quotas are the Plexus backend's responsibility.
A connection without a valid key gets no refusal or dead socket — it is passed to the real target TLS server — loosely, the “decoy server” (in the current configuration, legitimate sites set in the camouflage configuration). That is why a single port :443 serves both VPN clients and ordinary requests. This yields a TLS-like external connection profile, but it is not a guarantee of traffic indistinguishability under every observation and analysis method — and this page makes no such guarantees.
Actual visibility depends on the observation point, the network path and configuration: the list above is what is fundamentally available on the path, not a claim that “the filter sees only this.”
Terms: an ingress path is the node through which the client establishes the VPN connection; an egress route is the node from which traffic leaves for the final resource. The RU relay is an ingress; the RU egress is a separate egress on the same host.
The subscription serves exactly the routes the account is entitled to: the base permission sees ingress via the RU relay; the RU-egress permission adds it to the set. The other transports are up and peers get registered on them, but they reach the user only through a config export — or not at all. The “working” statuses are a snapshot of observations in the scenarios used at publication time, not a guarantee of availability in every network.
Separately, there is an outbound-abuse filter: the Hetzner host blocks the BitTorrent protocol, outbound SMTP, requests to private ranges and administrative ports — a hoster requirement driven by DMCA/scan reports, not a functional policy of the service.
In the configuration in use, Xray access logging is disabled (the access log is turned off by a setting — it is the one that would record client addresses and destination domains). That does not mean network metadata is not processed by other components: each link has its own visibility and its own logging.
none added after discovery (2026-11-26); the systemd service journal remains. Accepts only from the Hetzner host's IP (ufw) — a network-access restriction, not a privacy guarantee on the node itself or at the downstream providersThe table describes the components' technical capabilities and the logging settings at the snapshot date: the ability to process data does not mean it is necessarily stored. Retention of our own journals is set by on-host rotation; provider policies are set by their terms.
Trust boundaries. Internal APIs are isolated from external access; VPN management is separated from the messenger API; client configs in the database are encrypted; the Xray api inbound is unreachable outside the docker network; the relay's splice process holds no credentials (the RU egress on the same host is a separate service with its own configuration), and compromising the splice would affect availability and expose transport metadata (client IPs, timings, volumes) — not user keys.
Verifiable configuration and operations parameters, plus the live self-diagnostics series below — the service still does not collect usage metrics in client networks (active users, real speeds and user-side uptime).
Infrastructure self-diagnostics: every 5 minutes a script on the Hetzner host measures four reference paths and writes the result to a public JSON. This is the server side — not a measurement inside a client network; failures are marked red.
The architecture changed not only as a result of the initial design but also under the pressure of production operations. The main takeaway: a working transport configuration is only part of a reliable VPN service. Just as important are state consistency, shared-host resource planning, observability, controlled key rotation and predictable recovery. Below is an honest backlog: these are directions and statuses, not finished features.
Both core nodes run the sweep in parallel: idempotency prevents breakage but not double rotations and races on key removal. The user-visible effect is extra key reissues; a postgres advisory lock is needed.
A full relay outage is already caught by the probe inside the service — the route drops out of the served set within a minute; but degradation — loss, rising latency — can still be first noticed by the client. Synthetic checks of every subscription route — from inside and outside — should catch degradation before user complaints. The first step is done: a probe on the Hetzner host already collects the live series for the “Live probes” section — next comes degradation assessment and a signal to a human.
A single RU machine is both a point of failure and a traffic ceiling (its monthly hoster budget is already protected by the guard). A second relay is capacity headroom and a step toward removing the single point of failure (a client-switchover procedure is still needed).
Depending on a single implementation is a risk: analysis of HTTP/3 transports remains a research direction, not a promise of a specific release; the transport layer is kept replaceable.
A config in the repository does not guarantee the container runs on it: bind-mounts and stale files have already cost a two-day degradation. A “what is actually applied” check after deploy is needed.
The splitter and xray counters, the quota meters and the RU node's NIC metrics live in different places, and an incident showed that “written to the container log” ≠ “someone saw it.” A single overview plane is needed — usage metrics on the already-accumulating counters — plus delivery of the signal to a responsible human.
The full JSON can carry routing rules, but the universal
vless:// link list cannot transport them — a client
that imports only individual links does not get those rules.
This is a limitation of the format and the current delivery
method, not a guarantee that bypass works: rule correctness
needs verification and delivery to clients that understand
them.
Xray is the base network engine; everything that turns it into a service was designed and integrated inside Plexus: the account and permission binding, the subscription model, quotas, the key lifecycle, gateway-to-database reconciliation, deployment and operations. My role was architecture, task decomposition, implementation review and acceptance; AI tools were used on individual tasks — the requirements, verification and decisions to accept results are mine. Xray, nginx, Caddy and amneziawg-go are third-party components: the contribution is selection, configuration and integration, not authorship of the engines.