From f3c641b82d503becf3040935e01060464397194b Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Thu, 17 Aug 2023 14:49:44 +0100 Subject: [PATCH] Add websocket upgrade log and allow websocket flag for routes --- proxy/websocket/server.go | 2 ++ target/flags.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/websocket/server.go b/proxy/websocket/server.go index dc80d97..eaea0c0 100644 --- a/proxy/websocket/server.go +++ b/proxy/websocket/server.go @@ -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 diff --git a/target/flags.go b/target/flags.go index 026863e..6534b62 100644 --- a/target/flags.go +++ b/target/flags.go @@ -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 )