Class SocketTrapper<S>

The special SocketWrapper version used by TocketClientBrowser to capture third party WebSocket connections once they initialise via the proxied WebSocket Object.

Type Parameters

Hierarchy

customData: Record<string, Serializable> = {}
messageLog: string[] = []

If logging is enabled all intercepted messages will be stored here

  • get alive(): boolean
  • Utility function for checking if a socket is alive.

    Returns boolean

    true if the socket is alive, false if it isn't

Primary Controls

inbound: InboundAdapter = ...

Inbound transformation object, converts input from the webSocket into valid SocketRequests

outbound: OutboundAdapter = ...

Outbound transformation object, applied to the SocketRequest just before it is sent.

  • Function to be executed when connection to the main webSocket is established

    Returns any

Overrides

General Properties

captureTime: undefined | number
delayedSource: undefined | string | SocketLike

The [source]

identifier: string

The name used by Clients for targeting the Socket

initialized: boolean = true

true* If the WebSocket connection should be initialized immediately,

logging: LoggingTypes = 'none'

Smarkand. Funnelly

maxRetries: number = 5

The number of times the SocketWrapper will try to reconnect to a WebSocket after the connection is lost.

registration: TocketClientBase<S>

The TocketClient this SocketWrapper is registered to.

retryInterval: number = 5000

How long to wait between each connection attempt

source: string | SocketLike

The WebSocket or URL that will be wrapped by the SocketWrapper

timeout?: number

The number of Milliseconds this socket will wait for responses form other endpoints.

Internal Data

interceptor: TrapFunction

Generated using TypeDoc