Skip to content

lightgun-poc / lib/tunnel / pickTunnel

Function: pickTunnel()

pickTunnel(body, port): string | null

Defined in: lib/tunnel.ts:75

Finds our own HTTPS endpoint in an agent API response.

The agent may be forwarding several ports (a shared machine, a second project), so the local port is matched rather than "first tunnel wins", and only https is accepted — a plain-http endpoint is not a secure context and WebXR would refuse it.

Parameters

body

unknown

port

number

Returns

string | null

Released under the MIT License.