mirror of
https://github.com/fatedier/frp.git
synced 2025-08-02 20:11:46 +00:00
config: add VhostEnableH2C flag to support HTTP/2 cleartext upgrade
This commit is contained in:
@@ -70,6 +70,7 @@ type serverInfoResp struct {
|
||||
Version string `json:"version"`
|
||||
BindPort int `json:"bindPort"`
|
||||
VhostHTTPPort int `json:"vhostHTTPPort"`
|
||||
VhostEnableH2C bool `json:"vhostEnableH2C"`
|
||||
VhostHTTPSPort int `json:"vhostHTTPSPort"`
|
||||
TCPMuxHTTPConnectPort int `json:"tcpmuxHTTPConnectPort"`
|
||||
KCPBindPort int `json:"kcpBindPort"`
|
||||
@@ -111,6 +112,7 @@ func (svr *Service) apiServerInfo(w http.ResponseWriter, r *http.Request) {
|
||||
BindPort: svr.cfg.BindPort,
|
||||
VhostHTTPPort: svr.cfg.VhostHTTPPort,
|
||||
VhostHTTPSPort: svr.cfg.VhostHTTPSPort,
|
||||
VhostEnableH2C: svr.cfg.VhostEnableH2C,
|
||||
TCPMuxHTTPConnectPort: svr.cfg.TCPMuxHTTPConnectPort,
|
||||
KCPBindPort: svr.cfg.KCPBindPort,
|
||||
QUICBindPort: svr.cfg.QUICBindPort,
|
||||
|
@@ -281,6 +281,7 @@ func NewService(cfg *v1.ServerConfig) (*Service, error) {
|
||||
if cfg.VhostHTTPPort > 0 {
|
||||
rp := vhost.NewHTTPReverseProxy(vhost.HTTPReverseProxyOptions{
|
||||
ResponseHeaderTimeoutS: cfg.VhostHTTPTimeout,
|
||||
EnableH2C: cfg.VhostEnableH2C,
|
||||
}, svr.httpVhostRouter)
|
||||
svr.rc.HTTPReverseProxy = rp
|
||||
|
||||
|
Reference in New Issue
Block a user