src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/local_screens.h
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-07-17 19:49:47 -0500
committerLuke Hoersten <[email protected]>2026-07-17 19:49:47 -0500
commit3821512b18be69cad002faf77f1e5844bda13c95 (patch)
tree885f61c3c76f5e4dc4f8d16050da6bc96abe032d /main/local_screens.h
parent2a4b8296d71f25e5a29a07ea6cc9f3ac31676c48 (diff)
scrypted: mdns discovery — browse, host choices, auto-heal
Browse for _scrypted-viewport._tcp with a plain dgram socket on an EPHEMERAL port: per RFC 6762 §6.7 a query from a non-5353 source port is a legacy unicast query and responders reply unicast to that port — verified in the ESP-IDF responder (mdns_send.c answers to the querier's addr/port whenever src_port != 5353). No :5353 bind means no conflict with Scrypted's own HomeKit mDNS or a host avahi-daemon, and it works under Docker host-networking or native alike. One response packet carries PTR+SRV+TXT+A (RFC 6763 §12.1), so parsing is per-packet with no follow-up queries; the wire codec (name compression included) is ~150 lines, no dependencies. Surfaced three ways: - add-device form: host field is a combobox listing discovered viewports as "ip — name (vX, WxH)"; manual entry still works and only the address token is stored. - child settings page: same choices on the existing host field. - auto-heal: when a /config register fails, re-browse and match by MAC (seeded from /state and discovery; survives renames) then by name; on a hit at a new address, rewrite host and retry once. Runs only on register failure, so it's rate-limited to the 5-min cycle and removes the need for a DHCP reservation. Browses are best-effort ([] on any failure) and cached 30s so settings re-renders don't spam the LAN. diagnostic.ts gains the same browse as a paste-and-run probe that validates dgram + multicast reachability from inside the real Scrypted sandbox before trusting the feature.
Diffstat (limited to 'main/local_screens.h')
0 files changed, 0 insertions, 0 deletions