mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-27 01:50:30 +08:00
[WEBSOCKET]在日志中增加详细错误提示/TLS连接增加InsecureSkipVerify选项
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package nodes
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -11,6 +12,7 @@ import (
|
||||
func (this *HTTPRequest) doWebsocket() {
|
||||
if this.web.WebsocketRef == nil || !this.web.WebsocketRef.IsOn || this.web.Websocket == nil || !this.web.Websocket.IsOn {
|
||||
this.writer.WriteHeader(http.StatusForbidden)
|
||||
this.addError(errors.New("websocket have not been enabled yet"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -23,6 +25,7 @@ func (this *HTTPRequest) doWebsocket() {
|
||||
if err == nil {
|
||||
if !this.web.Websocket.MatchOrigin(u.Host) {
|
||||
this.writer.WriteHeader(http.StatusForbidden)
|
||||
this.addError(errors.New("websocket origin '" + requestOrigin + "' not been allowed"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user