diff --git a/server/service.go b/server/service.go index 2f93f90..f461009 100644 --- a/server/service.go +++ b/server/service.go @@ -140,7 +140,7 @@ func NewService() (svr *Service, err error) { } // Listen for accepting connections from client using websocket protocol. - websocketPrefix := []byte("GET /%23frp") + websocketPrefix := []byte("GET " + frpNet.FrpWebsocketPath) websocketLn := svr.muxer.Listen(0, uint32(len(websocketPrefix)), func(data []byte) bool { return bytes.Equal(data, websocketPrefix) }) @@ -165,8 +165,8 @@ func NewService() (svr *Service, err error) { err = fmt.Errorf("Create vhost http listener error, %v", err) return } - go server.Serve(l) } + go server.Serve(l) log.Info("http service listen on %s:%d", cfg.ProxyBindAddr, cfg.VhostHttpPort) } diff --git a/utils/net/websocket.go b/utils/net/websocket.go index a3bf0f0..8ecc17e 100644 --- a/utils/net/websocket.go +++ b/utils/net/websocket.go @@ -18,7 +18,7 @@ var ( ) const ( - FrpWebsocketPath = "/#frp" + FrpWebsocketPath = "/~!frp" ) type WebsocketListener struct {