0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-14 20:39:36 +03:00

Add YAML Support (#86)

This commit is contained in:
Monsoon
2020-12-25 03:30:26 +08:00
committed by GitHub
parent f073456ac0
commit 85619b5a29
7 changed files with 96 additions and 0 deletions

View File

@ -152,6 +152,8 @@ func getConfigFilePath() cmdarg.Arg {
func getConfigFormat() string {
switch strings.ToLower(*format) {
case "yaml", "yml":
return "yaml"
case "pb", "protobuf":
return "protobuf"
case "toml":
@ -165,6 +167,9 @@ func startXray() (core.Server, error) {
configFiles := getConfigFilePath()
config, err := core.LoadConfig(getConfigFormat(), configFiles[0], configFiles)
//config, err := core.LoadConfigs(getConfigFormat(), configFiles)
if err != nil {
return nil, newError("failed to load config files: [", configFiles.String(), "]").Base(err)
}