MCPcopy
hub / github.com/infinitered/reactotron / Server

Class Server

lib/reactotron-core-server/src/reactotron-core-server.ts:65–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 * The Reactotron server.
64 */
65export default class Server {
66 /**
67 * An event emitter which fires events from connected clients.
68 */
69 emitter = mitt<ServerEventMap>()
70
71 /**
72 * Additional server configuration.
73 */
74 options: ServerOptions = mergeRight({}, DEFAULTS)
75
76 /**
77 * A unique id which is assigned to each inbound message.
78 */
79 messageId = 0
80
81 /**
82 * A unique id which is assigned to each inbound connection.
83 */
84 connectionId = 0
85
86 /**
87 * Which redux state locations we are subscribing to.
88 */
89 subscriptions: string[] = []
90
91 /**
92 * Registered custom commands per clientId.
93 */
94 customCommands: Map<
95 string,
96 { id: number; command: string; title?: string; description?: string; args?: any[] }[]
97 > = new Map()
98
99 /**
100 * Clients who are in the process of connecting but haven't yet handshaked.
101 */
102 partialConnections: PartialConnection[] = []
103
104 /**
105 * The web socket.
106 */
107 wss: WebSocketServer
108
109 /**
110 * Holds the currently connected clients.
111 */
112 connections = []
113
114 /**
115 * Have we started the server?
116 */
117 started = false
118
119 /**
120 * Keep alive interval to be running while the server is up.
121 */
122 keepAlive: ReturnType<typeof setInterval>

Callers

nothing calls this directly

Calls 6

repairFunction · 0.90
buildHttpsServerOptionsFunction · 0.85
createGuidFunction · 0.85
onMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected