Skip to content

Add devices by IP address #3

Description

@mxmgorin

Description

Add devices to the radar by entering an IP address (optionally :port), for networks where multicast discovery is blocked — guest/AP-isolation Wi-Fi, some corporate/VPN setups. Discovery is multicast-only today, so on those networks no peer ever appears and there's no way to send.

Plan

  1. New entry point on the Send tab's radar (e.g. a Select/hint action) or a Settings row: "Add by IP".
  2. Reuse the on-screen keyboard — add an OskTarget::PeerAddress (src/overlay/osk.rs) to type host[:port]; default the port to LocalSend's 53317 when omitted.
  3. On commit, POST our info to <scheme>://<host>:<port>{API_PREFIX}/register (same call as src/net/discovery.rs:252); the response carries the peer's DeviceInfo -> shared.peers.upsert(info, ip), so it appears on the radar and is selectable for send. Fall back to GET /info if /register fails.
  4. Toast the outcome ("Added " / "No device at ").

Notes

  • Manually-added peers must not silently expire: the radar prunes past PEER_TTL (src/net/discovery.rs:84). Either mark manual peers sticky, or re-poll their /info to keep them fresh.
  • Try HTTPS then plain HTTP, matching the send path's scheme handling.
  • Still needs L3 reachability (same subnet / routable) — this bypasses multicast discovery, not routing.
  • Address validation + IPv6 bracket form ([::1]:port).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions