mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
websocket: fix
This commit is contained in:
parent
941ac25648
commit
07623027bc
@ -140,7 +140,7 @@ func NewService() (svr *Service, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Listen for accepting connections from client using websocket protocol.
|
// 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 {
|
websocketLn := svr.muxer.Listen(0, uint32(len(websocketPrefix)), func(data []byte) bool {
|
||||||
return bytes.Equal(data, websocketPrefix)
|
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)
|
err = fmt.Errorf("Create vhost http listener error, %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
go server.Serve(l)
|
|
||||||
}
|
}
|
||||||
|
go server.Serve(l)
|
||||||
log.Info("http service listen on %s:%d", cfg.ProxyBindAddr, cfg.VhostHttpPort)
|
log.Info("http service listen on %s:%d", cfg.ProxyBindAddr, cfg.VhostHttpPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
FrpWebsocketPath = "/#frp"
|
FrpWebsocketPath = "/~!frp"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebsocketListener struct {
|
type WebsocketListener struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user