mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Add YAML Support (#86)
This commit is contained in:
parent
f073456ac0
commit
85619b5a29
7 changed files with 96 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue