mirror of
https://github.com/1f349/violet.git
synced 2024-11-24 04:11:32 +00:00
Add websocket upgrade log and allow websocket flag for routes
This commit is contained in:
parent
cf098eb0b9
commit
f3c641b82d
@ -33,6 +33,8 @@ func NewServer() *Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) Upgrade(rw http.ResponseWriter, req *http.Request) {
|
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)
|
c, err := upgrader.Upgrade(rw, req, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -14,7 +14,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
routeFlagMask = FlagPre | FlagAbs | FlagCors | FlagSecureMode | FlagForwardHost | FlagForwardAddr | FlagIgnoreCert
|
routeFlagMask = FlagPre | FlagAbs | FlagCors | FlagSecureMode | FlagForwardHost | FlagForwardAddr | FlagIgnoreCert | FlagWebsocket
|
||||||
redirectFlagMask = FlagPre | FlagAbs
|
redirectFlagMask = FlagPre | FlagAbs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user