toip.tools

interface · Node only

RelayOptions

@toip-tools/relayView source
TypeScriptImport
import { type RelayOptions } from "@toip-tools/relay";

Declaration

TypeScriptinterface
interface RelayOptions {
  port: number;
  dbPath: string;
  /** The URL clients use, e.g. wss://relay.example.com/v1. Defaults to ws://<host>:<port>/v1, or ws://localhost:<port>/v1 when bound to every interface. */
  publicUrl?: string;
  host?: string;
  log?: (line: string) => void;
  limits?: Partial<RelayLimits>;
  /** Called for every message the relay accepts: what an operator can see (sender, recipient, size, time), never the contents. */
  onStored?: (m: StoredMessage) => void;
}

Properties

portrequired
number
dbPathrequired
string
publicUrloptional
string | undefined

The URL clients use, e.g. wss://relay.example.com/v1. Defaults to ws://:/v1, or ws://localhost:/v1 when bound to every interface.

hostoptional
string | undefined
logoptional
((line: string) => void) | undefined
limitsoptional
Partial<RelayLimits> | undefined
onStoredoptional
((m: StoredMessage) => void) | undefined

Called for every message the relay accepts: what an operator can see (sender, recipient, size, time), never the contents.