MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / onOpen

Method onOpen

web/src/js/backends/websocket.tsx:75–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 }
74
75 async onOpen() {
76 // Send all queued messages.
77 for (const message of this.messageQueue) {
78 this.socket.send(JSON.stringify(message));
79 }
80 this.messageQueue = [];
81 // useful side effect: onStoreUpdate will be called
82 this.store.dispatch(connectionActions.startFetching());
83 await Promise.all([
84 this.fetchData(Resource.State),
85 this.fetchData(Resource.Flows),
86 this.fetchData(Resource.Events),
87 this.fetchData(Resource.Options),
88 ]);
89 this.store.dispatch(connectionActions.finishFetching());
90 }
91
92 onStoreUpdate() {
93 const storeFilterState = this.store.getState().ui.filter;

Callers 1

connectMethod · 0.95

Calls 3

fetchDataMethod · 0.95
dispatchMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected