From beca5152dd6e62979c4bbf445868ef902d2204cb Mon Sep 17 00:00:00 2001 From: mmmray <142015632+mmmray@users.noreply.github.com> Date: Tue, 16 Jul 2024 04:51:10 -0500 Subject: [PATCH] Fix "missing translation" alert and translate a few pages --- docs/.vuepress/config.ts | 1 + docs/.vuepress/config/sidebar/en.ts | 1 + docs/en/config/README.md | 14 ++++++++++-- docs/en/config/api.md | 34 ++++++++++++++++++++++++++++- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index b1fb755eb..45c9c4e00 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -28,6 +28,7 @@ export default defineUserConfig({ plugins: [ i18nPlugin({ updatedTime: "git", + translationGuide: "https://github.com/XTLS/Xray-docs-next", locales: { en: { lang: "en-US", diff --git a/docs/.vuepress/config/sidebar/en.ts b/docs/.vuepress/config/sidebar/en.ts index d86b69103..c10b93c2f 100755 --- a/docs/.vuepress/config/sidebar/en.ts +++ b/docs/.vuepress/config/sidebar/en.ts @@ -28,6 +28,7 @@ export const sidebarEn: SidebarConfig = { '/en/config/stats.md', '/en/config/transport.md', '/en/config/metrics.md', + '/en/config/observatory.md', ], }, { diff --git a/docs/en/config/README.md b/docs/en/config/README.md index 8b5814520..4d1f8e5ca 100644 --- a/docs/en/config/README.md +++ b/docs/en/config/README.md @@ -22,7 +22,9 @@ The configuration file of Xray is in JSON format, and the configuration format f "stats": {}, "reverse": {}, "fakedns": {}, - "metrics": {} + "metrics": {}, + "observatory": {}, + "burstObservatory": {} } ``` @@ -78,4 +80,12 @@ FakeDNS configuration. Can be used with a transparent proxy to obtain the actual > metrics: [metricsObject](./metrics.md) -Metrics configuration. A more straightforward (and hopefully better) way to export metrics. \ No newline at end of file +Metrics configuration. A more straightforward (and hopefully better) way to export metrics. + +> observatory: [ObservatoryObject](./observatory.md#observatoryobject) + +Background connection observation. Detect the connection status of outbound proxies. + +> burstObservatory: [BurstObservatoryObject](./observatory.md#burstobservatoryobject) + +Concurrent connection observation. Detect the connection status of outbound proxies. diff --git a/docs/en/config/api.md b/docs/en/config/api.md index 4e6eec8eb..be4cf9da6 100644 --- a/docs/en/config/api.md +++ b/docs/en/config/api.md @@ -7,7 +7,7 @@ The interface can be enabled through the api configuration module. When the api Please refer to the [related configuration](#related-configuration) in this section. ::: warning -Most users do not need to use this API. Novices can ignore this item directly. +Most users do not need to use this API. Novices can ignore this page entirely. ::: ## ApiObject @@ -18,6 +18,7 @@ Most users do not need to use this API. Novices can ignore this item directly. { "api": { "tag": "api", + "listen": "127.0.0.1:8080", "services": ["HandlerService", "LoggerService", "StatsService"] } } @@ -27,6 +28,13 @@ Most users do not need to use this API. Novices can ignore this item directly. Outbound proxy identifier. +> `listen`: string + +The IP and port that the API service listens on. This is an optional configuration item. + +When you omit this item, you need to add inbounds and routing configurations according to the examples in the [relevant configurations below](#related-configuration). + + > `services`: [string] List of enabled APIs, optional values can be found in [Supported API List](#supported-api-list). @@ -65,6 +73,18 @@ Add routing rules for the api inbound in the routing configuration. } ``` +Add api to basic configuration + +``` +"api": { + "tag": "api", + "services": [ + "StatsService" + ] +} +``` + + ## Supported API List ### HandlerService @@ -78,6 +98,18 @@ APIs that modify the inbound and outbound proxies, with the following available - Add a user to an inbound proxy (VMess, VLESS, Trojan, and Shadowsocks(v1.3.0+) only); - Delete a user from an inbound proxy (VMess, VLESS, Trojan, and Shadowsocks(v1.3.0+) only); +## RoutingService + +API for adding, deleting, and replacing routing rules and querying equalizer statistics. The available functions are as follows: + +* `adrules` adds and replaces routing configuration +* `rmrules` delete routing rules +* `sib` Disconnect source IP +* `bi` Query equalizer statistics +* `bo` Forces the equalizer to select the specified outboundTag + +You can use something like `./xray help api bi` to query the specific usage. + ### LoggerService Supports restarting the built-in logger, which can be used in conjunction with logrotate to perform operations on log files.