mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
otherwise a read timeout will occasionally occure
This commit is contained in:
parent
f4abf62f76
commit
24a1e34237
1 changed files with 1 additions and 0 deletions
|
@ -40,6 +40,7 @@ func (mod *RestAPI) streamEvent(ws *websocket.Conn, event session.Event) error {
|
|||
|
||||
func (mod *RestAPI) sendPing(ws *websocket.Conn) error {
|
||||
ws.SetWriteDeadline(time.Now().Add(writeWait))
|
||||
ws.SetReadDeadline(time.Now().Add(pongWait))
|
||||
if err := ws.WriteMessage(websocket.PingMessage, []byte{}); err != nil {
|
||||
mod.Error("Error while writing websocket ping message: %s", err)
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue