From 07623027bcf310d3454554fb35bdad77fa639985 Mon Sep 17 00:00:00 2001 From: fatedier Date: Fri, 10 Aug 2018 14:44:14 +0800 Subject: [PATCH] websocket: fix --- server/service.go | 4 ++-- utils/net/websocket.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/service.go b/server/service.go index 2f93f909..f4610095 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 a3bf0f0a..8ecc17e1 100644 --- a/utils/net/websocket.go +++ b/utils/net/websocket.go @@ -18,7 +18,7 @@ var ( ) const ( - FrpWebsocketPath = "/#frp" + FrpWebsocketPath = "/~!frp" ) type WebsocketListener struct {