"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cmd/frpc/sub/root.go" between
frp-0.36.1.tar.gz and frp-0.36.2.tar.gz

About: frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, and it also has a P2P connect mode.

root.go  (frp-0.36.1):root.go  (frp-0.36.2)
skipping to change at line 142 skipping to change at line 142
func parseClientCommonCfg(fileType int, source []byte) (cfg config.ClientCommonC onf, err error) { func parseClientCommonCfg(fileType int, source []byte) (cfg config.ClientCommonC onf, err error) {
if fileType == CfgFileTypeIni { if fileType == CfgFileTypeIni {
cfg, err = config.UnmarshalClientConfFromIni(source) cfg, err = config.UnmarshalClientConfFromIni(source)
} else if fileType == CfgFileTypeCmd { } else if fileType == CfgFileTypeCmd {
cfg, err = parseClientCommonCfgFromCmd() cfg, err = parseClientCommonCfgFromCmd()
} }
if err != nil { if err != nil {
return return
} }
err = cfg.Check() cfg.Complete()
err = cfg.Validate()
if err != nil { if err != nil {
err = fmt.Errorf("Parse config error: %v", err)
return return
} }
return return
} }
func parseClientCommonCfgFromCmd() (cfg config.ClientCommonConf, err error) { func parseClientCommonCfgFromCmd() (cfg config.ClientCommonConf, err error) {
cfg = config.GetDefaultClientConf() cfg = config.GetDefaultClientConf()
ipStr, portStr, err := net.SplitHostPort(serverAddr) ipStr, portStr, err := net.SplitHostPort(serverAddr)
if err != nil { if err != nil {
skipping to change at line 170 skipping to change at line 172
if err != nil { if err != nil {
err = fmt.Errorf("invalid server_addr: %v", err) err = fmt.Errorf("invalid server_addr: %v", err)
return return
} }
cfg.User = user cfg.User = user
cfg.Protocol = protocol cfg.Protocol = protocol
cfg.LogLevel = logLevel cfg.LogLevel = logLevel
cfg.LogFile = logFile cfg.LogFile = logFile
cfg.LogMaxDays = int64(logMaxDays) cfg.LogMaxDays = int64(logMaxDays)
if logFile == "console" {
cfg.LogWay = "console"
} else {
cfg.LogWay = "file"
}
cfg.DisableLogColor = disableLogColor cfg.DisableLogColor = disableLogColor
// Only token authentication is supported in cmd mode // Only token authentication is supported in cmd mode
cfg.ClientConfig = auth.GetDefaultClientConf() cfg.ClientConfig = auth.GetDefaultClientConf()
cfg.Token = token cfg.Token = token
cfg.TLSEnable = tlsEnable cfg.TLSEnable = tlsEnable
return return
} }
func runClient(cfgFilePath string) (err error) { func runClient(cfgFilePath string) (err error) {
var content []byte var content []byte
content, err = config.GetRenderedConfFromFile(cfgFilePath) content, err = config.GetRenderedConfFromFile(cfgFilePath)
if err != nil { if err != nil {
return return err
} }
cfg, err := parseClientCommonCfg(CfgFileTypeIni, content) cfg, err := parseClientCommonCfg(CfgFileTypeIni, content)
if err != nil { if err != nil {
return return err
} }
pxyCfgs, visitorCfgs, err := config.LoadAllProxyConfsFromIni(cfg.User, co ntent, cfg.Start) pxyCfgs, visitorCfgs, err := config.LoadAllProxyConfsFromIni(cfg.User, co ntent, cfg.Start)
if err != nil { if err != nil {
return return err
} }
err = startService(cfg, pxyCfgs, visitorCfgs, cfgFilePath) return startService(cfg, pxyCfgs, visitorCfgs, cfgFilePath)
return
} }
func startService( func startService(
cfg config.ClientCommonConf, cfg config.ClientCommonConf,
pxyCfgs map[string]config.ProxyConf, pxyCfgs map[string]config.ProxyConf,
visitorCfgs map[string]config.VisitorConf, visitorCfgs map[string]config.VisitorConf,
cfgFile string, cfgFile string,
) (err error) { ) (err error) {
log.InitLog(cfg.LogWay, cfg.LogFile, cfg.LogLevel, log.InitLog(cfg.LogWay, cfg.LogFile, cfg.LogLevel,
 End of changes. 7 change blocks. 
11 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)