From d75b33a3a336b16826dd8a2b5e3b03eb44c0164b Mon Sep 17 00:00:00 2001 From: nobody <59990325+vrnobody@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:55:43 +0800 Subject: [PATCH] Commands: "xray run -dump" supports reading JSON from STDIN (#5550) Fixes https://github.com/XTLS/Xray-core/issues/5534 --- core/config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/config.go b/core/config.go index 8f2018e6..3ab2a376 100644 --- a/core/config.go +++ b/core/config.go @@ -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,