MCPcopy Index your code
hub / github.com/bettercap/bettercap / startStreamingEvents

Method startStreamingEvents

modules/api_rest/api_rest_ws.go:105–118  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

103}
104
105func (mod *RestAPI) startStreamingEvents(w http.ResponseWriter, r *http.Request) {
106 ws, err := mod.upgrader.Upgrade(w, r, nil)
107 if err != nil {
108 if _, ok := err.(websocket.HandshakeError); !ok {
109 mod.Error("error while updating api.rest connection to websocket: %s", err)
110 }
111 return
112 }
113
114 mod.Debug("websocket streaming started for %s", r.RemoteAddr)
115
116 go mod.streamWriter(ws, w, r)
117 mod.streamReader(ws)
118}

Callers 1

showEventsMethod · 0.95

Calls 4

streamWriterMethod · 0.95
streamReaderMethod · 0.95
ErrorMethod · 0.45
DebugMethod · 0.45

Tested by

no test coverage detected