Skip to content

Latest commit

 

History

History
125 lines (63 loc) · 2.48 KB

File metadata and controls

125 lines (63 loc) · 2.48 KB

nostr-websocket-utils v0.3.16


nostr-websocket-utils / NostrWSServer

Class: NostrWSServer

Defined in: core/server.ts:19

NostrWSServer class for handling WebSocket connections

Constructors

Constructor

new NostrWSServer(options): NostrWSServer

Defined in: core/server.ts:25

Parameters

options

NostrWSServerOptions

Returns

NostrWSServer

Properties

wss

private wss: WebSocketServer

Defined in: core/server.ts:20


options

private options: NostrWSServerOptions

Defined in: core/server.ts:21


rateLimiter?

private optional rateLimiter: RateLimiter

Defined in: core/server.ts:22


pingInterval?

private optional pingInterval: Timeout

Defined in: core/server.ts:23

Methods

setupServer()

private setupServer(): void

Defined in: core/server.ts:54

Set up WebSocket server event handlers

Returns

void


handleMessage()

private handleMessage(socket, rawMessage): Promise<void>

Defined in: core/server.ts:97

Parameters

socket

NostrWSServerSocket

rawMessage

string

Returns

Promise<void>


startPingInterval()

private startPingInterval(): void

Defined in: core/server.ts:123

Start ping interval to check client connections

Returns

void


stop()

stop(): void

Defined in: core/server.ts:142

Stop the server and clean up resources

Returns

void