Skip to content

lightgun-poc / server / ServerOptions

Interface: ServerOptions

Defined in: server.ts:110

Options for startServer; every device/port is injectable for tests.

Properties

assets?

optional assets?: AssetSource

Defined in: server.ts:121

Overrides publicDir — how the single executable serves embedded files.


buttonsExplicit?

optional buttonsExplicit?: boolean

Defined in: server.ts:131

Whether buttonsFile was named by the user (--buttons): an unreadable explicit file is a reported problem, an absent implicit one (the default next to the exe / in public/) silently falls back to the asset copy. Defaults to buttonsFile !== undefined for embedded/test callers.


buttonsFile?

optional buttonsFile?: string

Defined in: server.ts:124


env?

optional env?: Record<string, string | undefined>

Defined in: server.ts:148


input?

optional input?: InputMode

Defined in: server.ts:142


key?

optional key?: string | null

Defined in: server.ts:159

Session key network clients must present (WS ?key=, /rtc/offer body). Undefined = generate one per run; null = gate off (trusted LAN).


keyboard?

optional keyboard?: KeyboardLike

Defined in: server.ts:123


keyLoopbackExempt?

optional keyLoopbackExempt?: boolean

Defined in: server.ts:164

Whether loopback connections skip the key (default true — the adb/USB flow). MUST be false when a tunnel forwards the internet to loopback.


loadNative?

optional loadNative?: () => Promise<LibNut>

Defined in: server.ts:144

Injected libnut loader for tests — replaces the real addon load.

Returns

Promise<LibNut>


log?

optional log?: (line) => void

Defined in: server.ts:140

Parameters

line

string

Returns

void


mode?

optional mode?: ServerMode

Defined in: server.ts:111


monitor?

optional monitor?: MonitorChoice

Defined in: server.ts:137

Where aim lands: one monitor, all of them, or the primary (default).


monitorProbe?

optional monitorProbe?: () => Promise<MonitorsReport>

Defined in: server.ts:139

Injected monitor detection for tests — replaces FFI/xrandr probing.

Returns

Promise<MonitorsReport>


mouse?

optional mouse?: MouseLike

Defined in: server.ts:122


pageOrigins?

optional pageOrigins?: string[]

Defined in: server.ts:152

Origins allowed to signal cross-origin. Default: the pageUrl origin.


pageUrl?

optional pageUrl?: string

Defined in: server.ts:150

Page the setup QR points at; also seeds the CORS allowlist.


pauseCombo?

optional pauseCombo?: string

Defined in: server.ts:133

PC key combo toggling tracking pause; "off" disables. Default shift+s.


pauseProbe?

optional pauseProbe?: ComboProbe

Defined in: server.ts:135

Injected combo probe for tests — replaces the real key-state FFI.


platform?

optional platform?: string

Defined in: server.ts:147


port?

optional port?: number

Defined in: server.ts:112


portFallback?

optional portFallback?: boolean

Defined in: server.ts:118

Degrade to an OS-assigned free port when port is busy (EADDRINUSE). Default false: embedded callers and tests keep exact-port semantics; the CLI sets it when the user did NOT pin --port/PORT themselves.


publicDir?

optional publicDir?: string

Defined in: server.ts:119


rtc?

optional rtc?: object

Defined in: server.ts:154

Injected WebRTC peer factory for tests — replaces real werift.

createPeer?

optional createPeer?: () => PeerLike

Returns

PeerLike


screen?

optional screen?: object

Defined in: server.ts:146

Screen assumed in virtual-input mode, where none can be measured.

h

h: number

w

w: number


statsIntervalMs?

optional statsIntervalMs?: number

Defined in: server.ts:141

Released under the MIT License.