|
@@ -1,6 +1,7 @@
|
|
|
package helper
|
|
|
|
|
|
import (
|
|
|
+ "strings"
|
|
|
"github.com/gorilla/websocket"
|
|
|
"github.com/pkg/errors"
|
|
|
"syscall"
|
|
@@ -15,6 +16,11 @@ func IsUnexpectedWebsocketError(err error) bool {
|
|
|
if errors.Is(err, syscall.EPIPE) {
|
|
|
return false
|
|
|
}
|
|
|
+ // client closed error: *net.OpErr
|
|
|
+ if strings.Contains(err.Error(), "An existing connection was forcibly closed by the remote host") {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
return websocket.IsUnexpectedCloseError(err,
|
|
|
websocket.CloseGoingAway,
|
|
|
websocket.CloseNoStatusReceived,
|