This commit is contained in:
tanghuafa 2020-05-10 17:23:05 +08:00
parent ccbf30242c
commit d0535e166c

View File

@ -60,6 +60,7 @@ var (
allowPorts string allowPorts string
maxPoolCount int64 maxPoolCount int64
maxPortsPerClient int64 maxPortsPerClient int64
tlsOnly bool
) )
func init() { func init() {
@ -87,6 +88,7 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&subDomainHost, "subdomain_host", "", "", "subdomain host") rootCmd.PersistentFlags().StringVarP(&subDomainHost, "subdomain_host", "", "", "subdomain host")
rootCmd.PersistentFlags().StringVarP(&allowPorts, "allow_ports", "", "", "allow ports") rootCmd.PersistentFlags().StringVarP(&allowPorts, "allow_ports", "", "", "allow ports")
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().BoolVarP(&tlsOnly, "tls_only", "", false, "frps tls only")
} }
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
@ -173,6 +175,7 @@ func parseServerCommonCfgFromCmd() (cfg config.ServerCommonConf, err error) {
cfg.LogLevel = logLevel cfg.LogLevel = logLevel
cfg.LogMaxDays = logMaxDays cfg.LogMaxDays = logMaxDays
cfg.SubDomainHost = subDomainHost cfg.SubDomainHost = subDomainHost
cfg.TlsOnly = tlsOnly
// Only token authentication is supported in cmd mode // Only token authentication is supported in cmd mode
cfg.AuthServerConfig = auth.GetDefaultAuthServerConf() cfg.AuthServerConfig = auth.GetDefaultAuthServerConf()