src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/viewport_state.h
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-15 09:46:21 -0500
committerLuke Hoersten <[email protected]>2026-06-15 09:46:21 -0500
commit103486c722907cc4aefdebe606e28ea5c9565901 (patch)
treeac0850cf2f6508c8169d9831313278e700db6c80 /main/viewport_state.h
parente85b67b902e678b5c2517b656c1ca95435cf6aec (diff)
scrypted: make undici dispatcher optional, fall back to per-POST sockets
Scrypted's plugin sandbox doesn't always expose 'undici' as a require()-able module — it's bundled into the runtime but only reachable through globalThis.fetch internals, not as a CommonJS module. require('undici') threw and broke registerViewport entirely. Wrap the require in try/catch and cache the result. When undici is available we still get keep-alive + 2 socket pool for pipelining; when it isn't, dispatcherFor returns undefined and we fall back to plain fetch with a fresh socket per POST. The X-Frame-Seq deduplication on the firmware side still works regardless — even without socket pooling, two fetch() calls can be in flight on two separate ephemeral sockets concurrently.
Diffstat (limited to 'main/viewport_state.h')
0 files changed, 0 insertions, 0 deletions