Skip to main content
When a backend exposes itself on the network — over LAN or Tailscale HTTPS — you can connect to it directly by its WebSocket URL, with no SSH tunnel. This is the simplest path on a trusted network or a tailnet.
A direct connection rides an exposed network port, so it’s always token-gated. On an untrusted network, prefer an SSH tunnel instead.

From Another Mains Desktop App

Open Relay in the sidebar, go to Add, and choose Direct URL.
1

Name the backend

A label for your client list.
2

Enter the WebSocket URL

The host’s This machine panel lists its addresses as http://… links. The WebSocket URL is the same address with the scheme swapped:
3

Enter the pairing token

The token shown in the host’s panel (or printed by npm run serve). Required whenever the backend was started with one.
4

Add, then Connect

The status dot turns connected and the UI drives the remote backend.

From A Phone Or Browser

Every exposed address has a browser link that loads the full Mains UI in a web browser, with the token already embedded:
Open it on a phone, tablet, or any browser. In the web client you’re already connected to the backend that served the page — adding or switching backends stays a desktop-app feature.
The installed Mains app already ships the web UI — there is nothing to build. The npm run build:web step only applies when the host is running Mains from source (npm start / npm run serve), where the interface is served by the Vite dev server rather than from a build on disk. See Share this machine.

Managing Backends

Saved backends live under Relay, alongside Local (this machine): Switching is instant and non-destructive — your local data is untouched while a remote backend is active.