diff --git a/docs/document/command.md b/docs/document/command.md index de246fa..0f86f89 100644 --- a/docs/document/command.md +++ b/docs/document/command.md @@ -103,9 +103,9 @@ xray api [arguments] ### xray convert -把配置文件转换成 protobuf 或者把 typedMessage 转换成 json +把配置文件转换成 protobuf 或者把 typedMessage 转换成 JSON -使用方法: +使用方法: ``` xray convert [arguments] @@ -116,7 +116,7 @@ The commands are: json Convert typedMessage to json ``` -pb 子命令使用示例: +`pb` 子命令使用示例: ```bash # 用法:xray convert pb [-debug] [-type] [json file] [json file] ... diff --git a/docs/en/document/command.md b/docs/en/document/command.md index 4f2bcad..f69f29d 100644 --- a/docs/en/document/command.md +++ b/docs/en/document/command.md @@ -51,7 +51,12 @@ Default "json". The -test flag tells Xray to test config files only, without launching the server + +The -dump flag tells Xray to print the merged config. ``` +::: tip +Except from the default JSON format, config can also use TOML and YAML. It will automatically recognized from file extensions when the `-format` flag is not set. +::: ### xray version @@ -84,6 +89,59 @@ xray api [arguments] rmo Remove outbounds ``` +### xray convert + +Convert config to protobuf, or convert typedMessage to JSON + +usage: + +``` +xray convert [arguments] + +The commands are: + + pb Convert multiple json configs to protobuf + json Convert typedMessage to json +``` + +Sub-command `pb` +```bash +# Usage: xray convert pb [-debug] [-type] [json file] [json file] ... + +# mix three config files to mix.pb +xray convert pb c1.json c2.json c3.json > mix.pb + +# Use -debug option to view the content of mix.pb +xray convert pb -debug mix.pb + +# Start Xray-core with mix.pb +xray -c mix.pb + +# Detailed usage +xray help convert pb +``` + +Sub-command JSON +```bash +# Usage: xray convert json [-type] [stdin:] [typedMessage file] + +tmsg='{ + "type": "xray.proxy.shadowsocks.Account", + "value": "CgMxMTEQBg==" +}' + +echo ${tmsg} | xray convert json stdin: + +# Outputs from above: +'{ + "cipherType": "AES_256_GCM", + "password": "111" +}' + +# Detailed usage +xray help convert json +``` + ### xray tls Some tools related to TLS. @@ -95,8 +153,9 @@ xray tls [arguments] ``` ``` - cert Generate TLS certificates - ping Ping the domain with TLS handshake + cert Generate TLS certificates + ping Ping the domain with TLS handshake + certChainHash Calculate TLS certificates hash. ``` ### xray uuid diff --git a/docs/ru/document/command.md b/docs/ru/document/command.md index 50b46ce..e09f74d 100644 --- a/docs/ru/document/command.md +++ b/docs/ru/document/command.md @@ -103,6 +103,59 @@ xray api [arguments] rmo Remove outbounds ``` +### xray convert + +Convert config to protobuf, or convert typedMessage to JSON + +usage: + +``` +xray convert [arguments] + +The commands are: + + pb Convert multiple json configs to protobuf + json Convert typedMessage to json +``` + +Sub-command `pb` +```bash +# Usage: xray convert pb [-debug] [-type] [json file] [json file] ... + +# mix three config files to mix.pb +xray convert pb c1.json c2.json c3.json > mix.pb + +# Use -debug option to view the content of mix.pb +xray convert pb -debug mix.pb + +# Start Xray-core with mix.pb +xray -c mix.pb + +# Detailed usage +xray help convert pb +``` + +Sub-command JSON +```bash +# Usage: xray convert json [-type] [stdin:] [typedMessage file] + +tmsg='{ + "type": "xray.proxy.shadowsocks.Account", + "value": "CgMxMTEQBg==" +}' + +echo ${tmsg} | xray convert json stdin: + +# Outputs from above: +'{ + "cipherType": "AES_256_GCM", + "password": "111" +}' + +# Detailed usage +xray help convert json +``` + ### xray tls Инструменты для работы с TLS.