Skip to content

Switch to the server's local address automatically at home #591

Closed

Description

@Quick104

Signed-in Android apps should switch to the server's local address at home the way the Apple apps now do. At home, a phone or TV saved with the server's public URL, reverse proxy or tunnel still sends every request the long way round: through hairpin NAT or the tunnel's bandwidth limits. The server also counts those streams as remote, because the address it sees is public.

What the server and the Apple app now do

  • The API port answers TLS as well as plain HTTP, with a self-signed certificate for a key derived from SECRET_KEY. GET /api/v2/system/connections carries an optional local_route object: spki_sha256, the base64 SHA-256 of that key's SubjectPublicKeyInfo, and url, the admin-set local address (server.local_url, Settings > General > Network) when there is one. Pairs with feat(discovery): let signed-in clients use the server's LAN address silo-server#2532.
  • The Apple app (feat(networking): use the server's local address automatically at home silo-apple#804) learns the pin only over a saved HTTPS address. It tries candidate local addresses as https on the same port, restricted to private IPv4 literals, and uses one only when TLS there presents the pinned key and GET /api/v2/system/identity answers the saved server's identity. The candidates are the admin-set address and _silo._tcp adverts whose TXT id matches. While a candidate passes, API requests, artwork and video media go there. The saved address stays the credential owner and the origin responses report. A connection failure on the local address drops it and retries once on the saved address. A network change, or the app returning to the foreground, checks again. The design and the client rules are in silo-server's docs/architecture/server-identity.md, "Local network TLS".

What Android needs

  • Read local_route from the connections document over the saved address, only when that address is HTTPS, and follow no redirect on that read. The decoder already ignores unknown keys.
  • A trust manager for OkHttp (and the player's data source) that accepts exactly the pinned key for the candidate host and port, and nothing else there. No public certificate is ever accepted for a candidate, and probes follow no redirect.
  • The same request rewrite and fallback rules, with the saved address as identity, and the same scope: token refresh, subtitles, audio, the realtime socket, Watch Party, downloads and casting stay on the saved address.
  • Candidates from local_route.url first. _silo._tcp adverts can follow once Android discovers them (feat(onboarding): list Silo servers found on the network and tailnet #460).
  • A "Connected on your local network" line on the active server in the server list, matching the Apple wording.

Rules the Apple reviews settled

  • Check only on Wi-Fi, Ethernet or another non-cellular network. A VPN running over cellular does not count. Any network change drops the route until a candidate passes again.
  • A connection failure on the route drops it at once. The request goes again to the saved address when it cannot have been sent (the connection, name lookup or TLS handshake failed), or when it is a GET or HEAD.
  • Video: a load on the route that fails to reach its source (a connection error, or a refused key) drops the route and opens the same plan once more from the saved address, keeping any Play or Pause made meanwhile. Failures about the media itself, such as an HTTP status or unreadable data, do not count against the route. A stream on the route that dies mid-playback reconnects from the saved address.
  • Artwork: any connection failure drops the route. A load that received nothing yet goes once more to the saved address.
  • No periodic re-checks. A failed check waits for the next network change, foreground return or advert change, so the app never keeps probing private addresses on networks that are not home.

Source: follow-up to Silo-Server/silo-apple#804


AI disclosure: drafted with Claude Code (claude-opus-5-5) while implementing Silo-Server/silo-apple#804.

Activity

  1. added
    enhancement
    priority: P2
    triaged
    on Oct 15, 2026
  2. self-assigned this
    on Oct 15, 2026
  3. Quick104 commented on Oct 15, 2026

    @Quick104
    ContributorAuthor

    🤖 AI agent claim. Claude Code in T3 Code (claude-opus-5-5) is working on a fix for this issue on behalf of @Quick104, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @Quick104.

  4. added a commit that references this issue on Oct 17, 2026
    578eedf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementpriority: P2triaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions