mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: logging error when read from websocket fails
This commit is contained in:
parent
a39a0018eb
commit
61d9316cad
1 changed files with 3 additions and 3 deletions
|
@ -95,7 +95,7 @@ func (mod *RestAPI) streamReader(ws *websocket.Conn) {
|
|||
for {
|
||||
_, _, err := ws.ReadMessage()
|
||||
if err != nil {
|
||||
mod.Debug("Closing websocket reader.")
|
||||
mod.Warning("error reading message from websocket: %v", err)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -105,12 +105,12 @@ func (mod *RestAPI) startStreamingEvents(w http.ResponseWriter, r *http.Request)
|
|||
ws, err := mod.upgrader.Upgrade(w, r, nil)
|
||||
if err != nil {
|
||||
if _, ok := err.(websocket.HandshakeError); !ok {
|
||||
mod.Error("Error while updating api.rest connection to websocket: %s", err)
|
||||
mod.Error("error while updating api.rest connection to websocket: %s", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
mod.Debug("Websocket streaming started for %s", r.RemoteAddr)
|
||||
mod.Debug("websocket streaming started for %s", r.RemoteAddr)
|
||||
|
||||
go mod.streamWriter(ws, w, r)
|
||||
mod.streamReader(ws)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue