MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / sendMessage

Method sendMessage

web/src/js/backends/websocket.tsx:170–178  ·  view source on GitHub ↗
(action: PayloadAction<any>)

Source from the content-addressed store, hash-verified

168 }
169
170 sendMessage(action: PayloadAction<any>) {
171 if (this.socket.readyState === WebSocket.OPEN) {
172 this.socket.send(JSON.stringify(action));
173 } else if (this.socket.readyState === WebSocket.CONNECTING) {
174 this.messageQueue.push(action);
175 } else {
176 console.error("WebSocket is not open. Cannot send:", action);
177 }
178 }
179
180 queueOrDispatch(resource: Resource, action: Action) {
181 const queue = this.activeFetches[resource];

Callers 2

onStoreUpdateMethod · 0.95
websocketSpec.tsxFile · 0.45

Calls 3

sendMethod · 0.45
pushMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected