Add websocket upgrade log and allow websocket flag for routes

This commit is contained in:
Melon 2023-08-17 14:49:44 +01:00
parent cf098eb0b9
commit f3c641b82d
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
2 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,8 @@ func NewServer() *Server {
}
func (s *Server) Upgrade(rw http.ResponseWriter, req *http.Request) {
log.Printf("[Websocket] Upgrading request to '%s' from '%s'\n", req.URL.String(), req.Header.Get("Origin"))
c, err := upgrader.Upgrade(rw, req, nil)
if err != nil {
return

View File

@ -14,7 +14,7 @@ const (
)
var (
routeFlagMask = FlagPre | FlagAbs | FlagCors | FlagSecureMode | FlagForwardHost | FlagForwardAddr | FlagIgnoreCert
routeFlagMask = FlagPre | FlagAbs | FlagCors | FlagSecureMode | FlagForwardHost | FlagForwardAddr | FlagIgnoreCert | FlagWebsocket
redirectFlagMask = FlagPre | FlagAbs
)