websocket: fix

This commit is contained in:
fatedier 2018-08-10 14:44:14 +08:00
parent 941ac25648
commit 07623027bc
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -18,7 +18,7 @@ var (
)
const (
FrpWebsocketPath = "/#frp"
FrpWebsocketPath = "/~!frp"
)
type WebsocketListener struct {