Repository navigation
Description
The workflow
I run one persistent bb server and use it from the native desktop and mobile apps, both at home/on the same LAN and remotely (e.g. on cellular).
- Pair a desktop/phone with that server through bb Connect.
- When the device can reach the same server directly on the trusted LAN, use the lower-latency local path.
- When it leaves the LAN or the local path fails, continue using the same server through bb Connect (or Connect Next, when available).
- When the verified LAN path becomes available again, optionally return to it without selecting another server profile or losing the current thread.
I would like one logical server with multiple transport endpoints, rather than manually switching between unrelated Direct and Connect entries.
What happens today
- Desktop exposes bb Connect servers and separate custom URLs. Mobile profiles have separate
directandconnectmodes, each storing a singleserverUrl; neither currently offers a LAN-first policy for a paired server. bb--connect-nextprovides a second remote Fly/FRP ingress (<label>.next.getbb.app), alongside the existing Connect address. Enabling it does not by itself make native clients use LAN direct or perform per-client route selection.- The current workaround is to save a separate LAN Direct entry and switch it manually, or keep using the Connect tunnel even when both devices are on the same LAN.
- Importantly, direct LAN access is not equivalent to authenticated bb Connect. The documented non-loopback direct API is unauthenticated and can read files or execute commands. A reachable IP or a successful
/healthrequest is not evidence that the endpoint is the user's paired bb server.
This is a feature proposal based on the current docs/source, not a claim of a measured performance regression or a live reproduction.
What you would expect
1. Opt-in, LAN-first endpoint selection (desktop and mobile)
- Keep the account-paired server as a single server identity and let it have multiple candidate routes: configured LAN URL (initial MVP), normal bb Connect URL, and optionally Connect Next URL.
- Offer an opt-in policy such as Auto (verified LAN first, Connect fallback), with an indication of the active route and a manual override.
- Probe the local candidate with a short bounded timeout on startup, network change, foreground resume, or connection failure. Do not equate a private IP/SSID/subnet with trust. Optional mDNS discovery can come later; a manually configured LAN URL is sufficient for an MVP.
- Fall back if LAN is unreachable, but avoid route flapping with debounce/backoff. Switching transports must not create a second logical server or duplicate a user action. Preserve/restore the current thread and resubscribe to realtime output after a connection changes.
2. Cryptographic verification and authorization before using LAN direct (security requirement, not optional polish)
- Establish the expected server identity/key through an already authenticated channel (e.g. initial Connect pairing or an explicit trusted enrollment), and pin it to that logical server.
- A LAN candidate must prove possession of the corresponding private key, ideally with a fresh nonce/challenge, and the client must check that it matches the paired server, not just that some service responds at the address. Reject mismatch, expired/replayed proof, and silent trust-key changes; allow an explicit re-enrollment/recovery flow.
- Identity verification alone is insufficient on plain HTTP: protect privileged API/WebSocket traffic against interception, modification and unauthorized peers (e.g. authenticated TLS with appropriately pinned identity, or an equivalent authenticated encrypted transport and client authorization). Do not transmit existing Connect credentials, session cookies or sensitive request content to an unverified LAN endpoint.
- Fail closed on verification/authentication errors. Never downgrade to an unauthenticated LAN API or broaden the server's default listen address just to enable automatic routing. A trusted proxy/Tailscale Serve may remain a supported direct route, but its trust model should be explicit.
3. Scope and suggested incremental delivery
- MVP: manually configured LAN endpoint + authenticated server binding + LAN probe/selection + Connect fallback in native desktop/mobile; visible current route and basic recovery.
- Follow-up: Connect Next as another fallback route, optional LAN discovery, hysteresis, and smoother preservation of realtime/WebView state across origin changes.
- It seems more appropriate for a shared client connection manager than for the Connect Next server plugin alone. Connect Next could advertise its endpoint and optional metadata, while native clients own reachability and route choice.
- Tests should cover: legitimate LAN, unknown/impersonating LAN service, intercepted or stale proof, credentials never sent before trust, Wi-Fi→cellular→Wi-Fi, server unreachable, suspended/resumed mobile app, and active thread/realtime reconnects.
I'm primarily requesting the product behavior and trust guarantees, not prescribing a particular protocol. A maintainer-approved minimal security design would be welcome before implementation.
Context and alternatives
- Official multi-device guidance explicitly warns that
--server-bind-host 0.0.0.0exposes an unauthenticated API: docs/multiple-devices.md. - Related but distinct: Unauthenticated RCE: server binds all interfaces and /api/v1 has no auth #1124 (unauthenticated network API exposure), BB_SERVER_BIND_HOST is loopback-or-wildcard only; no way to bind a single private interface #1754 (single private-interface binding), and Clipboard copy actions fail on plain-HTTP LAN origins #1590 (insecure HTTP LAN origins). This request is about verified endpoint selection and failover across transports, not a change to default binding or a request to allow unauthenticated LAN access.
- Current implementation references: mobile profile schema, mobile connection manager, desktop server target, Connect Next plugin.
- Alternative today: manually use separate Direct/Connect server entries, or use a trusted HTTPS proxy/Tailscale Serve route everywhere. Neither provides automatic LAN-first routing for an already paired server.
- I searched open and closed issues for the same request; the items above are related security/network issues, not an existing LAN-first verified routing request.
Checks
- I searched open and closed issues for the same request.
- If an agent wrote this, the body ends with
> AGENT GENERATED.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 31, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied the missing classification:
remote,security,connect.No existing classifications needed preservation; all applied values were verified. Final Type is Feature, so reproduction reporting and a fix PR are skipped. No PR: this requires product and authentication/transport design decisions, not a simple bug fix.
Use host Markdown for GitHub bodies and comments (#6752)
Reach machines over every enabled server route, behind the serverRout…
Stream terminal output to the server only while a client is subscribed (
Compress daemon and terminal WebSockets for peers on another machine (#…
Add an official Tailscale plugin that serves bb over Tailscale Serve (#…
Keep small daemon messages ahead of bulk data; stream file chunks as …
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Reach machines over every enabled server route, behind the serverRout…
Sign other devices in to bb, enforced by a Require sign-in switch (#8146