Change the name from "ResponseHeaderTimeout " to "vhost_http_timeout" and Use lowercase letter at the beginning
This commit is contained in:
parent
ecc9e32989
commit
a522be2e12
@ -37,30 +37,30 @@ var (
|
|||||||
cfgFile string
|
cfgFile string
|
||||||
showVersion bool
|
showVersion bool
|
||||||
|
|
||||||
bindAddr string
|
bindAddr string
|
||||||
bindPort int
|
bindPort int
|
||||||
bindUdpPort int
|
bindUdpPort int
|
||||||
kcpBindPort int
|
kcpBindPort int
|
||||||
proxyBindAddr string
|
proxyBindAddr string
|
||||||
vhostHttpPort int
|
vhostHttpPort int
|
||||||
vhostHttpsPort int
|
vhostHttpsPort int
|
||||||
dashboardAddr string
|
dashboardAddr string
|
||||||
dashboardPort int
|
dashboardPort int
|
||||||
dashboardUser string
|
dashboardUser string
|
||||||
dashboardPwd string
|
dashboardPwd string
|
||||||
assetsDir string
|
assetsDir string
|
||||||
logFile string
|
logFile string
|
||||||
logWay string
|
logWay string
|
||||||
logLevel string
|
logLevel string
|
||||||
logMaxDays int64
|
logMaxDays int64
|
||||||
token string
|
token string
|
||||||
authTimeout int64
|
authTimeout int64
|
||||||
subDomainHost string
|
subDomainHost string
|
||||||
tcpMux bool
|
tcpMux bool
|
||||||
allowPorts string
|
allowPorts string
|
||||||
maxPoolCount int64
|
maxPoolCount int64
|
||||||
maxPortsPerClient int64
|
maxPortsPerClient int64
|
||||||
ResponseHeaderTimeout int64
|
vhostHttpTimeout int64
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -86,7 +86,7 @@ func init() {
|
|||||||
rootCmd.PersistentFlags().Int64VarP(&authTimeout, "auth_timeout", "", 900, "auth timeout")
|
rootCmd.PersistentFlags().Int64VarP(&authTimeout, "auth_timeout", "", 900, "auth timeout")
|
||||||
rootCmd.PersistentFlags().StringVarP(&subDomainHost, "subdomain_host", "", "", "subdomain host")
|
rootCmd.PersistentFlags().StringVarP(&subDomainHost, "subdomain_host", "", "", "subdomain host")
|
||||||
rootCmd.PersistentFlags().Int64VarP(&maxPortsPerClient, "max_ports_per_client", "", 0, "max ports per client")
|
rootCmd.PersistentFlags().Int64VarP(&maxPortsPerClient, "max_ports_per_client", "", 0, "max ports per client")
|
||||||
rootCmd.PersistentFlags().Int64VarP(&ResponseHeaderTimeout, "Response_Header_Timeout", "", 30, "Response Header Timeout")
|
rootCmd.PersistentFlags().Int64VarP(&vhostHttpTimeout, "vhost_http_timeout", "", 30, "vhost http timeout")
|
||||||
}
|
}
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
@ -179,7 +179,7 @@ func parseServerCommonCfgFromCmd() (err error) {
|
|||||||
g.GlbServerCfg.AuthTimeout = authTimeout
|
g.GlbServerCfg.AuthTimeout = authTimeout
|
||||||
g.GlbServerCfg.SubDomainHost = subDomainHost
|
g.GlbServerCfg.SubDomainHost = subDomainHost
|
||||||
g.GlbServerCfg.MaxPortsPerClient = maxPortsPerClient
|
g.GlbServerCfg.MaxPortsPerClient = maxPortsPerClient
|
||||||
g.GlbServerCfg.ResponseHeaderTimeout = ResponseHeaderTimeout
|
g.GlbServerCfg.VhostHttpTimeout = vhostHttpTimeout
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,5 +67,5 @@ subdomain_host = frps.com
|
|||||||
# if tcp stream multiplexing is used, default is true
|
# if tcp stream multiplexing is used, default is true
|
||||||
tcp_mux = true
|
tcp_mux = true
|
||||||
|
|
||||||
# if Response Header Timeout more the 30s ,fix the pars .
|
# if long connection for more than 30 seconds and disconnection of the server ,fix the pars .
|
||||||
ResponseHeaderTimeout = 30
|
vhost_http_timeout = 30
|
@ -68,42 +68,42 @@ type ServerCommonConf struct {
|
|||||||
SubDomainHost string `json:"subdomain_host"`
|
SubDomainHost string `json:"subdomain_host"`
|
||||||
TcpMux bool `json:"tcp_mux"`
|
TcpMux bool `json:"tcp_mux"`
|
||||||
|
|
||||||
AllowPorts map[int]struct{}
|
AllowPorts map[int]struct{}
|
||||||
MaxPoolCount int64 `json:"max_pool_count"`
|
MaxPoolCount int64 `json:"max_pool_count"`
|
||||||
MaxPortsPerClient int64 `json:"max_ports_per_client"`
|
MaxPortsPerClient int64 `json:"max_ports_per_client"`
|
||||||
HeartBeatTimeout int64 `json:"heart_beat_timeout"`
|
HeartBeatTimeout int64 `json:"heart_beat_timeout"`
|
||||||
UserConnTimeout int64 `json:"user_conn_timeout"`
|
UserConnTimeout int64 `json:"user_conn_timeout"`
|
||||||
ResponseHeaderTimeout int64 `json:"Response_Header_Timeout"`
|
VhostHttpTimeout int64 `json:"vhost_http_timeout "`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetDefaultServerConf() *ServerCommonConf {
|
func GetDefaultServerConf() *ServerCommonConf {
|
||||||
return &ServerCommonConf{
|
return &ServerCommonConf{
|
||||||
BindAddr: "0.0.0.0",
|
BindAddr: "0.0.0.0",
|
||||||
BindPort: 7000,
|
BindPort: 7000,
|
||||||
BindUdpPort: 0,
|
BindUdpPort: 0,
|
||||||
KcpBindPort: 0,
|
KcpBindPort: 0,
|
||||||
ProxyBindAddr: "0.0.0.0",
|
ProxyBindAddr: "0.0.0.0",
|
||||||
VhostHttpPort: 0,
|
VhostHttpPort: 0,
|
||||||
VhostHttpsPort: 0,
|
VhostHttpsPort: 0,
|
||||||
DashboardAddr: "0.0.0.0",
|
DashboardAddr: "0.0.0.0",
|
||||||
DashboardPort: 0,
|
DashboardPort: 0,
|
||||||
DashboardUser: "admin",
|
DashboardUser: "admin",
|
||||||
DashboardPwd: "admin",
|
DashboardPwd: "admin",
|
||||||
AssetsDir: "",
|
AssetsDir: "",
|
||||||
LogFile: "console",
|
LogFile: "console",
|
||||||
LogWay: "console",
|
LogWay: "console",
|
||||||
LogLevel: "info",
|
LogLevel: "info",
|
||||||
LogMaxDays: 3,
|
LogMaxDays: 3,
|
||||||
Token: "",
|
Token: "",
|
||||||
AuthTimeout: 900,
|
AuthTimeout: 900,
|
||||||
SubDomainHost: "",
|
SubDomainHost: "",
|
||||||
TcpMux: true,
|
TcpMux: true,
|
||||||
AllowPorts: make(map[int]struct{}),
|
AllowPorts: make(map[int]struct{}),
|
||||||
MaxPoolCount: 5,
|
MaxPoolCount: 5,
|
||||||
MaxPortsPerClient: 0,
|
MaxPortsPerClient: 0,
|
||||||
HeartBeatTimeout: 90,
|
HeartBeatTimeout: 90,
|
||||||
UserConnTimeout: 10,
|
UserConnTimeout: 10,
|
||||||
ResponseHeaderTimeout: 30,
|
VhostHttpTimeout: 30,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,13 +302,13 @@ func UnmarshalServerConfFromIni(defaultCfg *ServerCommonConf, content string) (c
|
|||||||
cfg.HeartBeatTimeout = v
|
cfg.HeartBeatTimeout = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tmpStr, ok = conf.Get("common", "Response_Header_Timeout"); ok {
|
if tmpStr, ok = conf.Get("common", "vhost_http_timeout"); ok {
|
||||||
v, errRet := strconv.ParseInt(tmpStr, 10, 64)
|
v, errRet := strconv.ParseInt(tmpStr, 10, 64)
|
||||||
if errRet != nil {
|
if errRet != nil {
|
||||||
err = fmt.Errorf("Parse conf error: Response_Header_Timeout is incorrect")
|
err = fmt.Errorf("Parse conf error: vhost_http_timeout is incorrect")
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
cfg.ResponseHeaderTimeout = v
|
cfg.VhostHttpTimeout = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -32,7 +32,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
responseHeaderTimeout = time.Duration(g.GlbServerCfg.ResponseHeaderTimeout) * time.Second
|
responseHeaderTimeout = time.Duration(g.GlbServerCfg.VhostHttpTimeout) * time.Second
|
||||||
|
|
||||||
ErrRouterConfigConflict = errors.New("router config conflict")
|
ErrRouterConfigConflict = errors.New("router config conflict")
|
||||||
ErrNoDomain = errors.New("no such domain")
|
ErrNoDomain = errors.New("no such domain")
|
||||||
|
Loading…
Reference in New Issue
Block a user