mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
Merge pull request #825 from caisi35/dev
fix(analytic):client closed error in windows
This commit is contained in:
commit
4e319491b0
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue