Skip to content

Documentation / @super-line/core / ServerTransport

Interface: ServerTransport

Defined in: packages/core/src/transport.ts:84

Server side: the transport listens, authenticates each inbound connection at its native moment, and surfaces only the accepted ones — so the core never holds an unauthenticated connection.

Methods

start()

start(hooks): void | Promise<void>

Defined in: packages/core/src/transport.ts:85

Parameters

hooks
authenticate

(h) => Promise<AuthOutcome>

Core owns the decision; the transport calls this at its native auth point and rejects natively on throw.

onConnection

(raw, auth) => void

Fires ONLY for accepted connections.

reserved?

ReservedConnection[]

Reserved connection classes the core declares (from inspector + plugin connection classes). A transport that supports them advertises/matches these and short-circuits authenticate, accepting with the matched role and empty ctx. Transports without negotiation ignore this. See ReservedConnection.

Returns

void | Promise<void>


stop()

stop(): void | Promise<void>

Defined in: packages/core/src/transport.ts:98

Stop listening and drop in-flight connections.

Returns

void | Promise<void>

Released under the MIT License.