Commands: "xray run -dump" supports reading JSON from STDIN (#5550)

Fixes https://github.com/XTLS/Xray-core/issues/5534
This commit is contained in:
nobody
2026-01-16 18:55:43 +08:00
committed by GitHub
parent 7c418486c8
commit d75b33a3a3

View File

@@ -64,7 +64,11 @@ func GetMergedConfig(args cmdarg.Arg) (string, error) {
var files []*ConfigSource
supported := []string{"json", "yaml", "toml"}
for _, file := range args {
format := GetFormat(file)
format := "json"
if file != "stdin:" {
format = GetFormat(file)
}
if slices.Contains(supported, format) {
files = append(files, &ConfigSource{
Name: file,