-
-
Notifications
You must be signed in to change notification settings - Fork 2
Multi control
Multi-control connects m-ui panels as equal peers. There is no master, slave, or central coordinator. Each panel keeps its own identity and peer list, exchanges signed descriptors, and attempts direct connections to known members.
The network is useful for two features:
- Sync Inbound: actively copy selected inbounds and clients to trusted peers.
- Cross-panel subscriptions: pull and cache remote inbounds, then expose one aggregated subscription address.
Important
P2P membership is not NAT traversal. Every peer must be reachable over the advertised panel address and port, or through a reverse proxy that forwards the fixed peer paths.
Open Panel Settings → Multi-control. Set:
- Node Name: a human-readable name, up to 128 characters.
-
Local Node Address: the address other peers can reach, such as
https://panel-a.example.com:2053. It must contain only scheme, host, and panel port; do not include the hidden panel URI path.
If TLS is enabled, use a hostname covered by the certificate. m-ui does not disable certificate verification for peers.
Each installation creates data/multi-control.json with an Ed25519 private identity. Do not copy that file when cloning a panel to another server; doing so creates duplicate identities.
In the local Multi-control section, enable or generate a pairing token. m-ui generates 16 characters by default. A manually entered token may contain 16–32 lowercase letters and digits and must contain both a letter and a digit.
The token is used for the initial pairing handshake only. After pairing, the panels authenticate membership with signed node identities and use the trusted relationship for sync operations.
Treat the token like a bootstrap secret. Rotate it after onboarding the required peers, and never publish it in a screenshot or issue.
On another m-ui panel:
- Open Panel Settings → Multi-control.
- Click Add Connection.
- Enter the target panel host/IP, panel port, protocol (
auto,https, orhttp), and pairing token. - Confirm the connection.
auto tries HTTPS first and HTTP second. The target must have its pairing token enabled and its local node address configured. Once the first peer is connected, signed peer descriptors can introduce other members.
The peer list shows endpoint, node name, online state, last-seen time, and the last connection error. Offline members are retained and retried with backoff. A peer's advertised endpoint can be updated from that peer's own settings.
Disconnect is local: it removes the member from this panel and blocks automatic rediscovery. It does not globally remove the node from other panels. Use Allow rediscovery when you want a still-connected common member to introduce it again.
The network is limited to 128 saved members per panel. Heartbeats normally run every 15 seconds, and direct sync uses up to four concurrent peer requests.
The peer protocol is not under the hidden panel URI path. A reverse proxy must forward these fixed paths to the panel listener:
/_m-ui/peer/v1
/_m-ui/peer/inbound/v1
The dedicated subscription port does not expose either endpoint. Forward the paths to the panel port, preserve the Host header, and use a certificate trusted by the peer.
Open Inbounds → General Actions → Sync Inbound.
- The left side lists connected peers other than the current panel. They are selected by default.
- The matrix lists local
Username × Inboundrelationships. - Green cells are selected; white cells are deselected; gray cells have no actual Client and cannot be selected.
- Select whole peers, rows, columns, or individual cells.
- Click Sync, review the confirmation dialog, and confirm.
- Follow the per-peer progress and result window.
The transfer includes selected inbound configuration and clients. Existing copies created from the same source identity are updated; unrelated target clients, traffic counters, and online state are preserved. Name and port conflicts are reported rather than overwritten.
The operation is encrypted with a temporary X25519 session and AES-GCM payload, and authenticated by the trusted Ed25519 peer identities. Certificate/private-key references are converted to PEM content before transfer.
After a successful sync, restart Mihomo on the target panel. The result success means the target saved the inbound and regenerated YAML; it does not mean the target core has already reloaded it.
Configure Panel Settings → Subscription → Cross Panel Subscription Path first. It must look like /isub plus 16 lowercase letters/digits.
Then open Inbounds → General Actions → Export All Subscriptions (Cross Panel).
- Click Pull all inbound information.
- m-ui contacts every connected peer and reports progress.
- Remote inbound and Username-token data is cached under
data/cross-panel-subscriptions.json. - The local inbounds are always read live; remote data is retained when a temporary pull fails.
- Copy or download the generated bare URLs. Add
/clashto a URL for Mihomo YAML.
Remote nodes are sorted by inbound name. The cache is per source identity, so a panel going offline does not immediately erase its last successful data. Use Clear remote cache to remove all non-local cached sources.
The aggregated address has the form:
https://panel.example.com:port/<cross-panel-path>/<username-token>
https://panel.example.com:port/<cross-panel-path>/<username-token>/clash
The cross-panel page exposes only the Username's matching nodes. A remote node's share links use the remote peer host/port, while the page itself is served by the panel where aggregation was requested.
- Allow panel-to-panel TCP access in cloud security groups and firewalls.
- Use stable DNS names when peer addresses change.
- Keep system clocks synchronized.
- Configure TLS certificates that match the peer hostnames.
- Ensure reverse proxies pass both peer paths without adding the hidden panel path.
- Upgrade all participating panels before using new synchronization features.
Normal panel backups do not include multi-control.json. This prevents restoring a backup onto another machine from creating duplicate peer identities. To migrate the same physical server, move that file securely and preserve its permissions; when creating a new node, let m-ui generate a new identity.