MCPcopy Create free account
hub / github.com/cpaczek/skylight / onMessage

Method onMessage

web/src/tracker/connection.ts:82–91  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

80 }
81
82 private onMessage(raw: string): void {
83 let msg: TrackerServerMessage;
84 try {
85 msg = JSON.parse(raw) as TrackerServerMessage;
86 } catch {
87 return;
88 }
89 if (msg.type === "trackerState") this.update({ state: msg.state });
90 else if (msg.type === "trackerConfig") this.update({ config: msg.config });
91 }
92
93 send(msg: TrackerClientMessage): void {
94 if (this.ws?.readyState === WebSocket.OPEN) {

Callers 1

openMethod · 0.95

Calls 1

updateMethod · 0.95

Tested by

no test coverage detected