diff --git a/.github/check-scripts/check_code_focus.py b/.github/check-scripts/check_code_focus.py deleted file mode 100644 index 32bfd189..00000000 --- a/.github/check-scripts/check_code_focus.py +++ /dev/null @@ -1,105 +0,0 @@ -# Validate that lines covered by // [!code focus:N] form valid JSONC when wrapped in {}. -import re -import sys -from pathlib import Path - -FOCUS_RE = re.compile(r"//\s*\[!code focus:(\d+)\]") -CODEBLOCK_START = re.compile(r"^```json\w*") -CODEBLOCK_END = re.compile(r"^```\s*$") - - -def strip_jsonc_comments(text: str) -> str: - result = [] - for line in text.splitlines(): - stripped = line.lstrip() - if stripped.startswith("//"): - continue - if "//" in line: - in_str = False - escape = False - cut = -1 - for i, ch in enumerate(line): - if escape: - escape = False - continue - if ch == "\\": - escape = True - continue - if ch == '"': - in_str = not in_str - if not in_str and line[i : i + 2] == "//": - cut = i - break - if cut >= 0: - line = line[:cut] - result.append(line) - return "\n".join(result) - - -def validate_jsonc(fragment: str) -> str | None: - import json - - cleaned = strip_jsonc_comments(fragment) - wrapped = "{\n" + cleaned + "\n}" - try: - json.loads(wrapped) - return None - except json.JSONDecodeError as e: - return str(e) - - -def check_file(path: Path) -> list[str]: - errors = [] - lines = path.read_text(encoding="utf-8").splitlines() - in_json_block = False - - for i, line in enumerate(lines): - stripped = line.strip() - if CODEBLOCK_START.match(stripped): - in_json_block = True - continue - if CODEBLOCK_END.match(stripped): - in_json_block = False - continue - if not in_json_block: - continue - - m = FOCUS_RE.search(line) - if not m: - continue - - n = int(m.group(1)) - start = i + 1 - end = min(start + n, len(lines)) - fragment = "\n".join(lines[start:end]) - err = validate_jsonc(fragment) - if err: - rel = path.as_posix() - errors.append(f" {rel}:{i + 1} focus:{n} {err}") - - return errors - - -def main() -> int: - docs_root = Path.cwd() - all_errors: list[str] = [] - - for md in sorted(docs_root.rglob("*.md")): - text = md.read_text(encoding="utf-8") - if "[!code focus:" not in text: - continue - errs = check_file(md) - all_errors.extend(errs) - - if all_errors: - print(f"Found {len(all_errors)} invalid focus block(s):\n") - for e in all_errors: - print(e) - return 1 - - print("All focus blocks are valid JSONC.") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.github/workflows/postcheck.yml b/.github/workflows/postcheck.yml index b4a0efa5..2d1dd521 100644 --- a/.github/workflows/postcheck.yml +++ b/.github/workflows/postcheck.yml @@ -3,12 +3,6 @@ name: Post Check on: [push, pull_request] jobs: - check-focus: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - run: python .github/check-scripts/check_code_focus.py - check-json: runs-on: ubuntu-latest steps: diff --git a/.vitepress/config.mts b/.vitepress/config.mts index ab1e0839..357fc440 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -1,6 +1,7 @@ import { defineConfig } from "vitepress" import llmstxt from "vitepress-plugin-llms" import { MermaidMarkdown, MermaidPlugin } from "vitepress-plugin-mermaid" +import { fieldFocusPlugin } from "./plugins/field-focus.mts" import { nav as nav } from "./menus/nav.mts" import { nav as nav_en } from "./menus/nav.en.mts" @@ -52,8 +53,9 @@ export default defineConfig({ attrs: { left: "{:" }, - config(md) { + config(md: { use: Function }) { md.use(MermaidMarkdown) + md.use(fieldFocusPlugin) } }, vite: { @@ -80,7 +82,7 @@ export default defineConfig({ detailedView: true, miniSearch: { options: { - tokenize: (str) => str.split(/[\s,,。、]+/) + tokenize: (str: string) => str.split(/[\s,,。、]+/) } }, translations: { @@ -163,7 +165,7 @@ export default defineConfig({ options: { miniSearch: { options: { - tokenize: (str) => + tokenize: (str: string) => str .split(/[\s.,;!?'"(){}[\]\-_+=&%$#@~`^<>|\\]+/) .filter(Boolean) @@ -235,7 +237,8 @@ export default defineConfig({ options: { miniSearch: { options: { - tokenize: (str) => str.match(/[\p{L}\p{N}]+/gu) ?? [] + tokenize: (str: string) => + str.match(/[\p{L}\p{N}]+/gu) ?? [] } }, translations: { diff --git a/.vitepress/plugins/field-focus.mts b/.vitepress/plugins/field-focus.mts new file mode 100644 index 00000000..5a76ab43 --- /dev/null +++ b/.vitepress/plugins/field-focus.mts @@ -0,0 +1,98 @@ +// .vitepress/plugins/field-focus.mts +// +// markdown-it plugin: replaces // [!field focus] with // [!code focus:N] +// inside ```json fenced blocks. N is auto-calculated by bracket-matching +// the JSON field that starts on the very next line. + +const FIELD_FOCUS = /^(\s*)\/\/\s*\[!field\s+focus\]\s*$/ + +export function fieldFocusPlugin(md: { + core: { ruler: { push: Function } } +}): void { + md.core.ruler.push( + "field_focus", + (state: { + tokens: { type: string; info: string; content: string }[] + }) => { + for (const token of state.tokens) { + if (token.type !== "fence") continue + if (!/^json\b/.test(token.info.trim())) continue + token.content = rewriteFieldFocus(token.content) + } + } + ) +} + +/** Scan a code-block string, replacing every `// [!field focus]` line. */ +function rewriteFieldFocus(src: string): string { + const lines = src.split("\n") + const out: string[] = [] + + for (let i = 0; i < lines.length; i++) { + const m = FIELD_FOCUS.exec(lines[i]) + if (!m) { + out.push(lines[i]) + continue + } + const n = countFieldSpan(lines, i + 1) + out.push(`${m[1]}// [!code focus:${n}]`) + } + + return out.join("\n") +} + +/** + * Starting from `lines[start]`, find the first `{` or `[` (outside strings + * and // comments), then count lines until the matching `}` or `]`. + * Returns 1 when the line contains only a simple value (no bracket). + */ +function countFieldSpan(lines: string[], start: number): number { + if (start >= lines.length) return 1 + + let depth = 0 + let started = false + + for (let i = start; i < lines.length; i++) { + const line = lines[i] + let inStr = false + let skip = false + + for (let j = 0; j < line.length; j++) { + if (skip) { + skip = false + continue + } + + const ch = line[j] + + if (inStr) { + if (ch === "\\") { + skip = true + continue + } + if (ch === '"') inStr = false + continue + } + + if (ch === '"') { + inStr = true + continue + } + + // JSONC line comment — skip rest of line + if (ch === "/" && j + 1 < line.length && line[j + 1] === "/") break + + if (ch === "{" || ch === "[") { + depth++ + started = true + } else if (ch === "}" || ch === "]") { + depth-- + } + } + + if (started && depth <= 0) return i - start + 1 + } + + // No brackets found → simple value field, 1 line + return started ? lines.length - start : 1 +} diff --git a/docs/config/fakedns.md b/docs/config/fakedns.md index 72f9bdbf..19357fa8 100644 --- a/docs/config/fakedns.md +++ b/docs/config/fakedns.md @@ -133,7 +133,7 @@ FakeDNS 本质上是一个 [DNS 服务器](./dns.md#serverobject),能够与任 "inbounds": [ { // ... - // [!code focus:5] + // [!field focus] "sniffing": { "enabled": true, "destOverride": ["fakedns"], // 使用 "fakedns",或与其它 sniffer 搭配使用 diff --git a/docs/config/inbounds/http.md b/docs/config/inbounds/http.md index 980ec95c..8df50dae 100644 --- a/docs/config/inbounds/http.md +++ b/docs/config/inbounds/http.md @@ -30,7 +30,7 @@ HTTP 协议。 { // ... "protocol": "http", - // [!code focus:10] + // [!field focus] "settings": { "users": [ { diff --git a/docs/config/inbounds/hysteria.md b/docs/config/inbounds/hysteria.md index 26ca652c..bc96dd95 100644 --- a/docs/config/inbounds/hysteria.md +++ b/docs/config/inbounds/hysteria.md @@ -14,7 +14,7 @@ { // ... "protocol": "hysteria", - // [!code focus:10] + // [!field focus] "settings": { "version": 2, "users": [ diff --git a/docs/config/inbounds/shadowsocks.md b/docs/config/inbounds/shadowsocks.md index 226b5ef0..df139e4e 100644 --- a/docs/config/inbounds/shadowsocks.md +++ b/docs/config/inbounds/shadowsocks.md @@ -32,7 +32,7 @@ Shadowsocks 2022 新协议格式提升了性能并带有完整的重放保护, { // ... "protocol": "shadowsocks", - // [!code focus:13] + // [!field focus] "settings": { "network": "tcp,udp", "method": "aes-256-gcm", diff --git a/docs/config/inbounds/socks.md b/docs/config/inbounds/socks.md index 0264a51b..c9f12407 100644 --- a/docs/config/inbounds/socks.md +++ b/docs/config/inbounds/socks.md @@ -18,7 +18,7 @@ { // ... "protocol": "socks", - // [!code focus:12] + // [!field focus] "settings": { "auth": "noauth", "users": [ diff --git a/docs/config/inbounds/trojan.md b/docs/config/inbounds/trojan.md index ff59d304..c4c2bdd3 100644 --- a/docs/config/inbounds/trojan.md +++ b/docs/config/inbounds/trojan.md @@ -12,7 +12,7 @@ { // ... "protocol": "trojan", - // [!code focus:14] + // [!field focus] "settings": { "users": [ { diff --git a/docs/config/inbounds/tun.md b/docs/config/inbounds/tun.md index 06b272dd..82e49ee3 100644 --- a/docs/config/inbounds/tun.md +++ b/docs/config/inbounds/tun.md @@ -16,7 +16,7 @@ Linux 可选使用该环境变量传入 TUN FD 以进行某些轻量化或非特 { // ... "protocol": "tun", - // [!code focus:10] + // [!field focus] "settings": { "name": "utun10", "desc": "Wintun", diff --git a/docs/config/inbounds/tunnel.md b/docs/config/inbounds/tunnel.md index c24275c7..859ed672 100644 --- a/docs/config/inbounds/tunnel.md +++ b/docs/config/inbounds/tunnel.md @@ -12,7 +12,7 @@ Tunnel(隧道),旧称 dokodemo-door(任意门),可以监听数个本 { // ... "protocol": "tunnel", - // [!code focus:12] + // [!field focus] "settings": { "allowedNetwork": "tcp", "rewriteAddress": "8.8.8.8", diff --git a/docs/config/inbounds/vless.md b/docs/config/inbounds/vless.md index 1b0b3d25..23d6d6aa 100644 --- a/docs/config/inbounds/vless.md +++ b/docs/config/inbounds/vless.md @@ -14,7 +14,7 @@ VLESS 是一个无状态的轻量传输协议,它分为入站和出站两部 { // ... "protocol": "vless", - // [!code focus:18] + // [!field focus] "settings": { "users": [ { diff --git a/docs/config/inbounds/vmess.md b/docs/config/inbounds/vmess.md index 7f815ee9..5a7c7aac 100644 --- a/docs/config/inbounds/vmess.md +++ b/docs/config/inbounds/vmess.md @@ -16,7 +16,7 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在 { // ... "protocol": "vmess", - // [!code focus:12] + // [!field focus] "settings": { "users": [ { diff --git a/docs/config/inbounds/wireguard.md b/docs/config/inbounds/wireguard.md index 3698d525..e1e591c3 100644 --- a/docs/config/inbounds/wireguard.md +++ b/docs/config/inbounds/wireguard.md @@ -16,7 +16,7 @@ { // ... "protocol": "wireguard", - // [!code focus:14] + // [!field focus] "settings": { "secretKey": "SERVER_PRIVATE_KEY", "peers": [ diff --git a/docs/config/outbounds/blackhole.md b/docs/config/outbounds/blackhole.md index 6d793ab6..80b10db2 100644 --- a/docs/config/outbounds/blackhole.md +++ b/docs/config/outbounds/blackhole.md @@ -12,7 +12,7 @@ Blackhole(黑洞)是一个出站数据协议,它会阻碍所有数据的 { // ... "protocol": "blackhole", - // [!code focus:5] + // [!field focus] "settings": { "response": { "type": "none" diff --git a/docs/config/outbounds/dns.md b/docs/config/outbounds/dns.md index af387f8e..fc42bf49 100644 --- a/docs/config/outbounds/dns.md +++ b/docs/config/outbounds/dns.md @@ -16,7 +16,7 @@ DNS 是一个出站协议,用于接收由 routing 送入的 DNS 查询,并 { // ... "protocol": "dns", - // [!code focus:18] + // [!field focus] "settings": { "rewriteNetwork": "udp", "rewriteAddress": "1.1.1.1", diff --git a/docs/config/outbounds/freedom.md b/docs/config/outbounds/freedom.md index ff16fe01..e459db9d 100644 --- a/docs/config/outbounds/freedom.md +++ b/docs/config/outbounds/freedom.md @@ -16,7 +16,7 @@ Freedom 是一个直连出站协议,通常也是流量的终结点:它接收 { // ... "protocol": "freedom", - // [!code focus:28] + // [!field focus] "settings": { "redirect": "127.0.0.1:3366", "userLevel": 0, diff --git a/docs/config/outbounds/http.md b/docs/config/outbounds/http.md index b0b3d259..126e6cb6 100644 --- a/docs/config/outbounds/http.md +++ b/docs/config/outbounds/http.md @@ -20,7 +20,7 @@ HTTP 协议。 { // ... "protocol": "http", - // [!code focus:12] + // [!field focus] "settings": { "address": "192.168.108.1", "port": 3128, diff --git a/docs/config/outbounds/hysteria.md b/docs/config/outbounds/hysteria.md index 7be3f9dc..4aa7577a 100644 --- a/docs/config/outbounds/hysteria.md +++ b/docs/config/outbounds/hysteria.md @@ -18,7 +18,7 @@ Hysteria 协议的客户端实现。 { // ... "protocol": "hysteria", - // [!code focus:5] + // [!field focus] "settings": { "version": 2, "address": "192.168.108.1", diff --git a/docs/config/outbounds/loopback.md b/docs/config/outbounds/loopback.md index 81724fe6..1d7c2e5b 100644 --- a/docs/config/outbounds/loopback.md +++ b/docs/config/outbounds/loopback.md @@ -27,7 +27,7 @@ Loopback 是一个环回出站,用于将流量重新送回 routing 处理, { // ... "protocol": "loopback", - // [!code focus:4] + // [!field focus] "settings": { "inboundTag": "TagUseAsInbound", "sniffing": {} diff --git a/docs/config/outbounds/shadowsocks.md b/docs/config/outbounds/shadowsocks.md index db7a414a..fbb7510a 100644 --- a/docs/config/outbounds/shadowsocks.md +++ b/docs/config/outbounds/shadowsocks.md @@ -32,7 +32,7 @@ Shadowsocks 2022 新协议格式提升了性能并带有完整的重放保护, { // ... "protocol": "shadowsocks", - // [!code focus:8] + // [!field focus] "settings": { "email": "love@xray.com", "address": "127.0.0.1", diff --git a/docs/config/outbounds/socks.md b/docs/config/outbounds/socks.md index 5fd122ad..b0085c64 100644 --- a/docs/config/outbounds/socks.md +++ b/docs/config/outbounds/socks.md @@ -16,7 +16,7 @@ { // ... "protocol": "socks", - // [!code focus:8] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 1234, diff --git a/docs/config/outbounds/trojan.md b/docs/config/outbounds/trojan.md index 948e8148..fd23866d 100644 --- a/docs/config/outbounds/trojan.md +++ b/docs/config/outbounds/trojan.md @@ -12,7 +12,7 @@ { // ... "protocol": "trojan", - // [!code focus:7] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 1234, diff --git a/docs/config/outbounds/vless.md b/docs/config/outbounds/vless.md index 63a9dc3c..a12c507a 100644 --- a/docs/config/outbounds/vless.md +++ b/docs/config/outbounds/vless.md @@ -14,7 +14,7 @@ VLESS 是一个无状态的轻量传输协议,它分为入站和出站两部 { // ... "protocol": "vless", - // [!code focus:9] + // [!field focus] "settings": { "address": "example.com", "port": 443, diff --git a/docs/config/outbounds/vmess.md b/docs/config/outbounds/vmess.md index b9c2937b..93e105c0 100644 --- a/docs/config/outbounds/vmess.md +++ b/docs/config/outbounds/vmess.md @@ -16,7 +16,7 @@ VMess 依赖于系统时间,请确保使用 Xray 的系统 UTC 时间误差在 { // ... "protocol": "vmess", - // [!code focus:8] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 37192, diff --git a/docs/config/outbounds/wireguard.md b/docs/config/outbounds/wireguard.md index 1b74bd78..f4f404a3 100644 --- a/docs/config/outbounds/wireguard.md +++ b/docs/config/outbounds/wireguard.md @@ -16,7 +16,7 @@ { // ... "protocol": "wireguard", - // [!code focus:20] + // [!field focus] "settings": { "secretKey": "CLIENT_PRIVATE_KEY", "address": ["10.0.0.1", "fd59:7153:2388:b5fd:0000:0000:0000:0001"], diff --git a/docs/config/transport.md b/docs/config/transport.md index 75bbbc0b..8138e817 100644 --- a/docs/config/transport.md +++ b/docs/config/transport.md @@ -24,7 +24,7 @@ "outbounds": [ { // ... - // [!code focus:18] + // [!field focus] "streamSettings": { // 传输方式 "method": "raw", diff --git a/docs/config/transports/finalmask.md b/docs/config/transports/finalmask.md index 241f0c33..e0136fbb 100644 --- a/docs/config/transports/finalmask.md +++ b/docs/config/transports/finalmask.md @@ -15,7 +15,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 { // ... "streamSettings": { - // [!code focus:33] + // [!field focus] "finalmask": { "tcp": [ { @@ -62,7 +62,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "finalmask": { - // [!code focus:6] + // [!field focus] "tcp": [ { "type": "", @@ -88,7 +88,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "type": "header-custom", - // [!code focus:35] + // [!field focus] "settings": { "clients": [ [ @@ -142,7 +142,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "type": "fragment", - // [!code focus:6] + // [!field focus] "settings": { "packets": "tlshello", "lengths": ["3-5", "6-8", "10-20"], @@ -175,7 +175,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "type": "sudoku", - // [!code focus:10] + // [!field focus] "settings": { "password": "", "ascii": "", @@ -198,7 +198,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "finalmask": { - // [!code focus:6] + // [!field focus] "udp": [ { "type": "", @@ -226,7 +226,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "type": "header-custom", - // [!code focus:18] + // [!field focus] "settings": { "client": [ { @@ -261,7 +261,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "type": "mkcp-legacy", - // [!code focus:4] + // [!field focus] "settings": { "header": "", // dns dtls srtp utp wechat wireguard "value": "" // password domain @@ -292,7 +292,7 @@ FinalMask 在核心处理完包括 TLS/REALITY 在内的传输层加密后,对 ```json { "type": "noise", - // [!code focus:12] + // [!field focus] "settings": { "reset": "30-60", "noise": [ @@ -327,7 +327,7 @@ Salamander 混淆。(来自 Hysteria2) ```json { "type": "salamander", - // [!code focus:4] + // [!field focus] "settings": { "password": "your-password", "packetSize": "512-1200" @@ -348,7 +348,7 @@ Salamander 混淆。(来自 Hysteria2) ```json { "type": "sudoku", - // [!code focus:10] + // [!field focus] "settings": { "password": "", "ascii": "", @@ -379,7 +379,7 @@ Salamander 混淆。(来自 Hysteria2) ```json { "type": "xdns", - // [!code focus:4] + // [!field focus] "settings": { "domains": ["t.example.com"], "resolvers": ["t.example.com+udp://8.8.8.8:53"] @@ -398,7 +398,7 @@ Salamander 混淆。(来自 Hysteria2) ```json { "type": "xicmp", - // [!code focus:4] + // [!field focus] "settings": { "dgram": false, // optional "ips": [] // optional @@ -417,7 +417,7 @@ Salamander 混淆。(来自 Hysteria2) ```json { "type": "realm", - // [!code focus:8] + // [!field focus] "settings": { "url": "realm://public@xxx/your-realm-name", "stunServers": [ @@ -442,7 +442,7 @@ Salamander 混淆。(来自 Hysteria2) ```json { "finalmask": { - // [!code focus:19] + // [!field focus] "quicParams": { "congestion": "force-brutal", "bbrProfile": "standard", diff --git a/docs/config/transports/grpc.md b/docs/config/transports/grpc.md index 35fe17d4..f9902267 100644 --- a/docs/config/transports/grpc.md +++ b/docs/config/transports/grpc.md @@ -48,7 +48,7 @@ gRPC(HTTP/2)内置多路复用,不建议使用 gRPC 与 HTTP/2 时启用 m // ... "streamSettings": { "method": "grpc", - // [!code focus:10] + // [!field focus] "grpcSettings": { "authority": "grpc.example.com", "serviceName": "name", diff --git a/docs/config/transports/httpupgrade.md b/docs/config/transports/httpupgrade.md index 5887cd38..9946084a 100644 --- a/docs/config/transports/httpupgrade.md +++ b/docs/config/transports/httpupgrade.md @@ -19,7 +19,7 @@ // ... "streamSettings": { "method": "httpupgrade", - // [!code focus:8] + // [!field focus] "httpupgradeSettings": { "acceptProxyProtocol": false, "path": "/", diff --git a/docs/config/transports/hysteria.md b/docs/config/transports/hysteria.md index daeba02d..68064cd8 100644 --- a/docs/config/transports/hysteria.md +++ b/docs/config/transports/hysteria.md @@ -14,7 +14,7 @@ Hysteria2 的底层 QUIC 传输的 Xray 实现,通常搭配 hysteria[出站](. // ... "streamSettings": { "method": "hysteria", - // [!code focus:17] + // [!field focus] "hysteriaSettings": { "version": 2, "auth": "password", diff --git a/docs/config/transports/mkcp.md b/docs/config/transports/mkcp.md index beb77a70..2dd725ba 100644 --- a/docs/config/transports/mkcp.md +++ b/docs/config/transports/mkcp.md @@ -20,7 +20,7 @@ mKCP 牺牲带宽来降低延迟。传输同样的内容,mKCP 一般比 TCP // ... "streamSettings": { "method": "mkcp", - // [!code focus:9] + // [!field focus] "kcpSettings": { "mtu": 1350, "tti": 20, diff --git a/docs/config/transports/raw.md b/docs/config/transports/raw.md index b7fc9ddc..945a1f50 100644 --- a/docs/config/transports/raw.md +++ b/docs/config/transports/raw.md @@ -16,7 +16,7 @@ // ... "streamSettings": { "method": "raw", - // [!code focus:6] + // [!field focus] "rawSettings": { "acceptProxyProtocol": false, "header": { diff --git a/docs/config/transports/reality.md b/docs/config/transports/reality.md index bfbc459b..9eaed312 100644 --- a/docs/config/transports/reality.md +++ b/docs/config/transports/reality.md @@ -26,7 +26,7 @@ REALITY 只是修改了 TLS,客户端的实现只需要轻度修改完全随 // ... "streamSettings": { "security": "reality", - // [!code focus:30] + // [!field focus] "realitySettings": { // 入站(服务端)配置 "show": false, diff --git a/docs/config/transports/sockopt.md b/docs/config/transports/sockopt.md index e6d09012..54006b09 100644 --- a/docs/config/transports/sockopt.md +++ b/docs/config/transports/sockopt.md @@ -15,7 +15,7 @@ Sockopt 用于配置底层网络行为。 { // ... "streamSettings": { - // [!code focus:21] + // [!field focus] "sockopt": { "mark": 0, "tcpMaxSeg": 1440, diff --git a/docs/config/transports/tls.md b/docs/config/transports/tls.md index f5ed4332..2094bf30 100644 --- a/docs/config/transports/tls.md +++ b/docs/config/transports/tls.md @@ -18,7 +18,7 @@ TLS 是常见的传输层加密方式。 // ... "streamSettings": { "security": "tls", - // [!code focus:20] + // [!field focus] "tlsSettings": { "serverName": "xray.com", "verifyPeerCertByName": "", diff --git a/docs/config/transports/websocket.md b/docs/config/transports/websocket.md index 6a53ba68..5fcd6540 100644 --- a/docs/config/transports/websocket.md +++ b/docs/config/transports/websocket.md @@ -24,7 +24,7 @@ Websocket 会识别 HTTP 请求的 X-Forwarded-For 头来覆写流量的源地 // ... "streamSettings": { "method": "websocket", - // [!code focus:9] + // [!field focus] "wsSettings": { "acceptProxyProtocol": false, "path": "/", diff --git a/docs/en/config/fakedns.md b/docs/en/config/fakedns.md index 4222c36c..9e9c6427 100644 --- a/docs/en/config/fakedns.md +++ b/docs/en/config/fakedns.md @@ -133,7 +133,7 @@ Additionally, you need to enable `Sniffing` on the inbound of the **client** tha "inbounds": [ { // ... - // [!code focus:5] + // [!field focus] "sniffing": { "enabled": true, "destOverride": ["fakedns"], // Use "fakedns", or combine with other sniffers diff --git a/docs/en/config/inbounds/http.md b/docs/en/config/inbounds/http.md index 08c46014..79734c4b 100644 --- a/docs/en/config/inbounds/http.md +++ b/docs/en/config/inbounds/http.md @@ -30,7 +30,7 @@ Use the following environment variables in Linux to enable a global HTTP proxy f { // ... "protocol": "http", - // [!code focus:10] + // [!field focus] "settings": { "users": [ { diff --git a/docs/en/config/inbounds/hysteria.md b/docs/en/config/inbounds/hysteria.md index c8dd2868..f0bc1804 100644 --- a/docs/en/config/inbounds/hysteria.md +++ b/docs/en/config/inbounds/hysteria.md @@ -14,7 +14,7 @@ The `hysteria protocol` itself has no authentication; `users` only take effect w { // ... "protocol": "hysteria", - // [!code focus:10] + // [!field focus] "settings": { "version": 2, "users": [ diff --git a/docs/en/config/inbounds/shadowsocks.md b/docs/en/config/inbounds/shadowsocks.md index a7c9fe9d..b954b7c8 100644 --- a/docs/en/config/inbounds/shadowsocks.md +++ b/docs/en/config/inbounds/shadowsocks.md @@ -32,7 +32,7 @@ The Shadowsocks 2022 new protocol format improves performance and includes compl { // ... "protocol": "shadowsocks", - // [!code focus:13] + // [!field focus] "settings": { "network": "tcp,udp", "method": "aes-256-gcm", diff --git a/docs/en/config/inbounds/socks.md b/docs/en/config/inbounds/socks.md index eac26cab..403648e8 100644 --- a/docs/en/config/inbounds/socks.md +++ b/docs/en/config/inbounds/socks.md @@ -18,7 +18,7 @@ A more meaningful usage of `Socks` inbound is to listen within a LAN or on the l { // ... "protocol": "socks", - // [!code focus:12] + // [!field focus] "settings": { "auth": "noauth", "users": [ diff --git a/docs/en/config/inbounds/trojan.md b/docs/en/config/inbounds/trojan.md index 9b101f26..7130e64f 100644 --- a/docs/en/config/inbounds/trojan.md +++ b/docs/en/config/inbounds/trojan.md @@ -12,7 +12,7 @@ { // ... "protocol": "trojan", - // [!code focus:14] + // [!field focus] "settings": { "users": [ { diff --git a/docs/en/config/inbounds/tun.md b/docs/en/config/inbounds/tun.md index 00c88409..30cd4ec9 100644 --- a/docs/en/config/inbounds/tun.md +++ b/docs/en/config/inbounds/tun.md @@ -16,7 +16,7 @@ On Linux, this environment variable can optionally be used to pass in the TUN FD { // ... "protocol": "tun", - // [!code focus:10] + // [!field focus] "settings": { "name": "utun10", "desc": "Wintun", diff --git a/docs/en/config/inbounds/tunnel.md b/docs/en/config/inbounds/tunnel.md index b97cc0ef..78786d55 100644 --- a/docs/en/config/inbounds/tunnel.md +++ b/docs/en/config/inbounds/tunnel.md @@ -12,7 +12,7 @@ Tunnel, formerly known as dokodemo-door (Arbitrary Door), can listen on multiple { // ... "protocol": "tunnel", - // [!code focus:12] + // [!field focus] "settings": { "allowedNetwork": "tcp", "rewriteAddress": "8.8.8.8", diff --git a/docs/en/config/inbounds/vless.md b/docs/en/config/inbounds/vless.md index de56c09d..c562d14a 100644 --- a/docs/en/config/inbounds/vless.md +++ b/docs/en/config/inbounds/vless.md @@ -14,7 +14,7 @@ Unlike [VMess](./vmess.md), VLESS does not depend on system time. The authentica { // ... "protocol": "vless", - // [!code focus:18] + // [!field focus] "settings": { "users": [ { diff --git a/docs/en/config/inbounds/vmess.md b/docs/en/config/inbounds/vmess.md index 88f792d3..124d7cc4 100644 --- a/docs/en/config/inbounds/vmess.md +++ b/docs/en/config/inbounds/vmess.md @@ -16,7 +16,7 @@ VMess depends on system time. Please ensure that the system UTC time of the devi { // ... "protocol": "vmess", - // [!code focus:12] + // [!field focus] "settings": { "users": [ { diff --git a/docs/en/config/inbounds/wireguard.md b/docs/en/config/inbounds/wireguard.md index 9ce9cc4f..f2132cb5 100644 --- a/docs/en/config/inbounds/wireguard.md +++ b/docs/en/config/inbounds/wireguard.md @@ -16,7 +16,7 @@ User-space WireGuard protocol implementation for establishing a WireGuard tunnel { // ... "protocol": "wireguard", - // [!code focus:14] + // [!field focus] "settings": { "secretKey": "SERVER_PRIVATE_KEY", "peers": [ diff --git a/docs/en/config/outbounds/blackhole.md b/docs/en/config/outbounds/blackhole.md index 01b1ab7a..90fadb97 100644 --- a/docs/en/config/outbounds/blackhole.md +++ b/docs/en/config/outbounds/blackhole.md @@ -12,7 +12,7 @@ Blackhole is an outbound data protocol that blocks all outbound data. When used { // ... "protocol": "blackhole", - // [!code focus:5] + // [!field focus] "settings": { "response": { "type": "none" diff --git a/docs/en/config/outbounds/dns.md b/docs/en/config/outbounds/dns.md index f2a1b0b4..9161f6e2 100644 --- a/docs/en/config/outbounds/dns.md +++ b/docs/en/config/outbounds/dns.md @@ -16,7 +16,7 @@ It can allow queries to the target DNS server, `hijack` them to the built-in [DN { // ... "protocol": "dns", - // [!code focus:18] + // [!field focus] "settings": { "rewriteNetwork": "udp", "rewriteAddress": "1.1.1.1", diff --git a/docs/en/config/outbounds/freedom.md b/docs/en/config/outbounds/freedom.md index 3632375d..f6532397 100644 --- a/docs/en/config/outbounds/freedom.md +++ b/docs/en/config/outbounds/freedom.md @@ -16,7 +16,7 @@ This outbound has a default safety policy in server-side and reverse-proxy scena { // ... "protocol": "freedom", - // [!code focus:28] + // [!field focus] "settings": { "redirect": "127.0.0.1:3366", "userLevel": 0, diff --git a/docs/en/config/outbounds/http.md b/docs/en/config/outbounds/http.md index 2791762c..a9d282b0 100644 --- a/docs/en/config/outbounds/http.md +++ b/docs/en/config/outbounds/http.md @@ -20,7 +20,7 @@ HTTP protocol. { // ... "protocol": "http", - // [!code focus:12] + // [!field focus] "settings": { "address": "192.168.108.1", "port": 3128, diff --git a/docs/en/config/outbounds/hysteria.md b/docs/en/config/outbounds/hysteria.md index a702e6d4..e25f0b4c 100644 --- a/docs/en/config/outbounds/hysteria.md +++ b/docs/en/config/outbounds/hysteria.md @@ -18,7 +18,7 @@ The `hysteria protocol` itself has no authentication. When using with a non `hys { // ... "protocol": "hysteria", - // [!code focus:5] + // [!field focus] "settings": { "version": 2, "address": "192.168.108.1", diff --git a/docs/en/config/outbounds/loopback.md b/docs/en/config/outbounds/loopback.md index ab86ab89..acb2530e 100644 --- a/docs/en/config/outbounds/loopback.md +++ b/docs/en/config/outbounds/loopback.md @@ -27,7 +27,7 @@ Avoid letting rules or balancers after the loopback select the original outbound { // ... "protocol": "loopback", - // [!code focus:4] + // [!field focus] "settings": { "inboundTag": "TagUseAsInbound", "sniffing": {} diff --git a/docs/en/config/outbounds/shadowsocks.md b/docs/en/config/outbounds/shadowsocks.md index d33ad9e8..d5c87385 100644 --- a/docs/en/config/outbounds/shadowsocks.md +++ b/docs/en/config/outbounds/shadowsocks.md @@ -32,7 +32,7 @@ The Shadowsocks 2022 new protocol format improves performance and includes compl { // ... "protocol": "shadowsocks", - // [!code focus:8] + // [!field focus] "settings": { "email": "love@xray.com", "address": "127.0.0.1", diff --git a/docs/en/config/outbounds/socks.md b/docs/en/config/outbounds/socks.md index 1526fafb..9e49d341 100644 --- a/docs/en/config/outbounds/socks.md +++ b/docs/en/config/outbounds/socks.md @@ -16,7 +16,7 @@ Standard Socks protocol implementation, compatible with Socks 5. { // ... "protocol": "socks", - // [!code focus:8] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 1234, diff --git a/docs/en/config/outbounds/trojan.md b/docs/en/config/outbounds/trojan.md index 2ab509cc..e648f4cf 100644 --- a/docs/en/config/outbounds/trojan.md +++ b/docs/en/config/outbounds/trojan.md @@ -12,7 +12,7 @@ { // ... "protocol": "trojan", - // [!code focus:7] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 1234, diff --git a/docs/en/config/outbounds/vless.md b/docs/en/config/outbounds/vless.md index e80fcdab..b7253b9d 100644 --- a/docs/en/config/outbounds/vless.md +++ b/docs/en/config/outbounds/vless.md @@ -14,7 +14,7 @@ Unlike [VMess](./vmess.md), VLESS does not depend on system time. The authentica { // ... "protocol": "vless", - // [!code focus:9] + // [!field focus] "settings": { "address": "example.com", "port": 443, diff --git a/docs/en/config/outbounds/vmess.md b/docs/en/config/outbounds/vmess.md index 7d0a1db7..572628e4 100644 --- a/docs/en/config/outbounds/vmess.md +++ b/docs/en/config/outbounds/vmess.md @@ -16,7 +16,7 @@ VMess depends on system time. Please ensure that the UTC time of the system runn { // ... "protocol": "vmess", - // [!code focus:8] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 37192, diff --git a/docs/en/config/outbounds/wireguard.md b/docs/en/config/outbounds/wireguard.md index c80ed085..ffa2634d 100644 --- a/docs/en/config/outbounds/wireguard.md +++ b/docs/en/config/outbounds/wireguard.md @@ -16,7 +16,7 @@ User-space WireGuard protocol implementation for establishing a WireGuard tunnel { // ... "protocol": "wireguard", - // [!code focus:20] + // [!field focus] "settings": { "secretKey": "CLIENT_PRIVATE_KEY", "address": ["10.0.0.1", "fd59:7153:2388:b5fd:0000:0000:0000:0001"], diff --git a/docs/en/config/transport.md b/docs/en/config/transport.md index 7601adde..7f4543c4 100644 --- a/docs/en/config/transport.md +++ b/docs/en/config/transport.md @@ -24,7 +24,7 @@ For direct outbounds such as [Freedom](./outbounds/freedom.md), the peer is usua "outbounds": [ { // ... - // [!code focus:18] + // [!field focus] "streamSettings": { // Transport methods "method": "raw", diff --git a/docs/en/config/transports/finalmask.md b/docs/en/config/transports/finalmask.md index e10fda2c..f66de00f 100644 --- a/docs/en/config/transports/finalmask.md +++ b/docs/en/config/transports/finalmask.md @@ -15,7 +15,7 @@ It can be used for multiple kinds of TCP and UDP camouflage, as well as QUIC-rel { // ... "streamSettings": { - // [!code focus:33] + // [!field focus] "finalmask": { "tcp": [ { @@ -62,7 +62,7 @@ An array used to camouflage TCP traffic emitted by the core. The first item in t ```json { "finalmask": { - // [!code focus:6] + // [!field focus] "tcp": [ { "type": "", @@ -88,7 +88,7 @@ See the fields for each type below. ```json { "type": "header-custom", - // [!code focus:35] + // [!field focus] "settings": { "clients": [ [ @@ -142,7 +142,7 @@ See the fields for each type below. ```json { "type": "fragment", - // [!code focus:6] + // [!field focus] "settings": { "packets": "tlshello", "lengths": ["3-5", "6-8", "10-20"], @@ -175,7 +175,7 @@ When it is `0` and `"packets": "tlshello"` is set, the fragmented Client Hello w ```json { "type": "sudoku", - // [!code focus:10] + // [!field focus] "settings": { "password": "", "ascii": "", @@ -198,7 +198,7 @@ An array used to camouflage UDP traffic emitted by the core. The first item in t ```json { "finalmask": { - // [!code focus:6] + // [!field focus] "udp": [ { "type": "", @@ -226,7 +226,7 @@ Always merged into the packet header. ```json { "type": "header-custom", - // [!code focus:18] + // [!field focus] "settings": { "client": [ { @@ -261,7 +261,7 @@ Always merged into the packet header. ```json { "type": "mkcp-legacy", - // [!code focus:4] + // [!field focus] "settings": { "header": "", // dns dtls srtp utp wechat wireguard "value": "" // password domain @@ -292,7 +292,7 @@ Noise sent before the actual data. ```json { "type": "noise", - // [!code focus:12] + // [!field focus] "settings": { "reset": "30-60", "noise": [ @@ -327,7 +327,7 @@ Salamander obfuscation. From Hysteria2. ```json { "type": "salamander", - // [!code focus:4] + // [!field focus] "settings": { "password": "your-password", "packetSize": "512-1200" @@ -348,7 +348,7 @@ When non-empty, enables Gecko obfuscation, which applies additional fragmentatio ```json { "type": "sudoku", - // [!code focus:10] + // [!field focus] "settings": { "password": "", "ascii": "", @@ -379,7 +379,7 @@ For example, if you own `example.com`, set an A record like `a.example.com` to t ```json { "type": "xdns", - // [!code focus:4] + // [!field focus] "settings": { "domains": ["t.example.com"], "resolvers": ["t.example.com+udp://8.8.8.8:53"] @@ -398,7 +398,7 @@ At least one of `domains` and `resolvers` must be set. ```json { "type": "xicmp", - // [!code focus:4] + // [!field focus] "settings": { "dgram": false, // optional "ips": [] // optional @@ -417,7 +417,7 @@ Self-built https://github.com/apernet/hysteria-realm-server ```json { "type": "realm", - // [!code focus:8] + // [!field focus] "settings": { "url": "realm://public@xxx/your-realm-name", "stunServers": [ @@ -442,7 +442,7 @@ Connection failures require debug-level logging. Possible contributing factors i ```json { "finalmask": { - // [!code focus:19] + // [!field focus] "quicParams": { "congestion": "force-brutal", "bbrProfile": "standard", diff --git a/docs/en/config/transports/grpc.md b/docs/en/config/transports/grpc.md index c046c3f4..1996d08c 100644 --- a/docs/en/config/transports/grpc.md +++ b/docs/en/config/transports/grpc.md @@ -48,7 +48,7 @@ If you are using fallback, please note the following: // ... "streamSettings": { "method": "grpc", - // [!code focus:10] + // [!field focus] "grpcSettings": { "authority": "grpc.example.com", "serviceName": "name", diff --git a/docs/en/config/transports/httpupgrade.md b/docs/en/config/transports/httpupgrade.md index 43fe1405..50ce5d94 100644 --- a/docs/en/config/transports/httpupgrade.md +++ b/docs/en/config/transports/httpupgrade.md @@ -19,7 +19,7 @@ Its design is not recommended for standalone use; instead, it is intended to wor // ... "streamSettings": { "method": "httpupgrade", - // [!code focus:8] + // [!field focus] "httpupgradeSettings": { "acceptProxyProtocol": false, "path": "/", diff --git a/docs/en/config/transports/hysteria.md b/docs/en/config/transports/hysteria.md index 450eea49..ef90b669 100644 --- a/docs/en/config/transports/hysteria.md +++ b/docs/en/config/transports/hysteria.md @@ -14,7 +14,7 @@ Xray implementation of the underlying QUIC transport for Hysteria2, typically us // ... "streamSettings": { "method": "hysteria", - // [!code focus:17] + // [!field focus] "hysteriaSettings": { "version": 2, "auth": "password", diff --git a/docs/en/config/transports/mkcp.md b/docs/en/config/transports/mkcp.md index 9be782e1..b2c900b4 100644 --- a/docs/en/config/transports/mkcp.md +++ b/docs/en/config/transports/mkcp.md @@ -20,7 +20,7 @@ Please ensure that the firewall configuration on the host is correct. // ... "streamSettings": { "method": "mkcp", - // [!code focus:9] + // [!field focus] "kcpSettings": { "mtu": 1350, "tti": 20, diff --git a/docs/en/config/transports/raw.md b/docs/en/config/transports/raw.md index 41ae3d54..b4391d08 100644 --- a/docs/en/config/transports/raw.md +++ b/docs/en/config/transports/raw.md @@ -16,7 +16,7 @@ It can be combined with various protocols in multiple modes. // ... "streamSettings": { "method": "raw", - // [!code focus:6] + // [!field focus] "rawSettings": { "acceptProxyProtocol": false, "header": { diff --git a/docs/en/config/transports/reality.md b/docs/en/config/transports/reality.md index 527f5720..93d4a497 100644 --- a/docs/en/config/transports/reality.md +++ b/docs/en/config/transports/reality.md @@ -26,7 +26,7 @@ For more information, see the [REALITY project](https://github.com/XTLS/REALITY) // ... "streamSettings": { "security": "reality", - // [!code focus:30] + // [!field focus] "realitySettings": { // Inbound (server-side) settings "show": false, diff --git a/docs/en/config/transports/sockopt.md b/docs/en/config/transports/sockopt.md index 4db430cf..177d3930 100644 --- a/docs/en/config/transports/sockopt.md +++ b/docs/en/config/transports/sockopt.md @@ -15,7 +15,7 @@ It can be used to tune transparent proxying, DNS resolution strategy, and many o { // ... "streamSettings": { - // [!code focus:21] + // [!field focus] "sockopt": { "mark": 0, "tcpMaxSeg": 1440, diff --git a/docs/en/config/transports/tls.md b/docs/en/config/transports/tls.md index 6a67d4e9..9717b718 100644 --- a/docs/en/config/transports/tls.md +++ b/docs/en/config/transports/tls.md @@ -18,7 +18,7 @@ It supports use with the `RAW`, `XHTTP`, `mKCP`, `gRPC`, `WebSocket`, `HTTPUpgra // ... "streamSettings": { "security": "tls", - // [!code focus:20] + // [!field focus] "tlsSettings": { "serverName": "xray.com", "verifyPeerCertByName": "", diff --git a/docs/en/config/transports/websocket.md b/docs/en/config/transports/websocket.md index e43ce0ec..df8e4cd2 100644 --- a/docs/en/config/transports/websocket.md +++ b/docs/en/config/transports/websocket.md @@ -24,7 +24,7 @@ WebSocket will recognize the `X-Forwarded-For` header in HTTP requests to overwr // ... "streamSettings": { "method": "websocket", - // [!code focus:9] + // [!field focus] "wsSettings": { "acceptProxyProtocol": false, "path": "/", diff --git a/docs/ru/config/fakedns.md b/docs/ru/config/fakedns.md index 4cf7cc6a..3d09f824 100644 --- a/docs/ru/config/fakedns.md +++ b/docs/ru/config/fakedns.md @@ -136,7 +136,7 @@ FakeDNS будет использовать этот блок IP-адресов "inbounds": [ { // ... - // [!code focus:5] + // [!field focus] "sniffing": { "enabled": true, "destOverride": ["fakedns"], // Используйте "fakedns" или в сочетании с другими снифферами. diff --git a/docs/ru/config/inbounds/http.md b/docs/ru/config/inbounds/http.md index 53013a88..92d5c59b 100644 --- a/docs/ru/config/inbounds/http.md +++ b/docs/ru/config/inbounds/http.md @@ -30,7 +30,7 @@ { // ... "protocol": "http", - // [!code focus:10] + // [!field focus] "settings": { "users": [ { diff --git a/docs/ru/config/inbounds/hysteria.md b/docs/ru/config/inbounds/hysteria.md index ef6011b6..c8ec9e2a 100644 --- a/docs/ru/config/inbounds/hysteria.md +++ b/docs/ru/config/inbounds/hysteria.md @@ -14,7 +14,7 @@ { // ... "protocol": "hysteria", - // [!code focus:10] + // [!field focus] "settings": { "version": 2, "users": [ diff --git a/docs/ru/config/inbounds/shadowsocks.md b/docs/ru/config/inbounds/shadowsocks.md index 51cb52dc..4fcaec53 100644 --- a/docs/ru/config/inbounds/shadowsocks.md +++ b/docs/ru/config/inbounds/shadowsocks.md @@ -32,7 +32,7 @@ { // ... "protocol": "shadowsocks", - // [!code focus:13] + // [!field focus] "settings": { "network": "tcp,udp", "method": "aes-256-gcm", diff --git a/docs/ru/config/inbounds/socks.md b/docs/ru/config/inbounds/socks.md index 09c1b004..16281755 100644 --- a/docs/ru/config/inbounds/socks.md +++ b/docs/ru/config/inbounds/socks.md @@ -18,7 +18,7 @@ { // ... "protocol": "socks", - // [!code focus:12] + // [!field focus] "settings": { "auth": "noauth", "users": [ diff --git a/docs/ru/config/inbounds/trojan.md b/docs/ru/config/inbounds/trojan.md index baaedf34..59fad44f 100644 --- a/docs/ru/config/inbounds/trojan.md +++ b/docs/ru/config/inbounds/trojan.md @@ -12,7 +12,7 @@ { // ... "protocol": "trojan", - // [!code focus:14] + // [!field focus] "settings": { "users": [ { diff --git a/docs/ru/config/inbounds/tun.md b/docs/ru/config/inbounds/tun.md index 2501f066..1b1bb6ac 100644 --- a/docs/ru/config/inbounds/tun.md +++ b/docs/ru/config/inbounds/tun.md @@ -16,7 +16,7 @@ { // ... "protocol": "tun", - // [!code focus:10] + // [!field focus] "settings": { "name": "utun10", "desc": "Wintun", diff --git a/docs/ru/config/inbounds/tunnel.md b/docs/ru/config/inbounds/tunnel.md index d2323f88..e150948b 100644 --- a/docs/ru/config/inbounds/tunnel.md +++ b/docs/ru/config/inbounds/tunnel.md @@ -12,7 +12,7 @@ { // ... "protocol": "tunnel", - // [!code focus:12] + // [!field focus] "settings": { "allowedNetwork": "tcp", "rewriteAddress": "8.8.8.8", diff --git a/docs/ru/config/inbounds/vless.md b/docs/ru/config/inbounds/vless.md index bca8aad4..056545a1 100644 --- a/docs/ru/config/inbounds/vless.md +++ b/docs/ru/config/inbounds/vless.md @@ -14,7 +14,7 @@ VLESS - это легкий транспортный протокол без с { // ... "protocol": "vless", - // [!code focus:18] + // [!field focus] "settings": { "users": [ { diff --git a/docs/ru/config/inbounds/vmess.md b/docs/ru/config/inbounds/vmess.md index b4588d0e..487454fb 100644 --- a/docs/ru/config/inbounds/vmess.md +++ b/docs/ru/config/inbounds/vmess.md @@ -16,7 +16,7 @@ VMess полагается на системное время. Убедитес { // ... "protocol": "vmess", - // [!code focus:12] + // [!field focus] "settings": { "users": [ { diff --git a/docs/ru/config/inbounds/wireguard.md b/docs/ru/config/inbounds/wireguard.md index af3126f0..429b46f6 100644 --- a/docs/ru/config/inbounds/wireguard.md +++ b/docs/ru/config/inbounds/wireguard.md @@ -16,7 +16,7 @@ { // ... "protocol": "wireguard", - // [!code focus:14] + // [!field focus] "settings": { "secretKey": "SERVER_PRIVATE_KEY", "peers": [ diff --git a/docs/ru/config/outbounds/blackhole.md b/docs/ru/config/outbounds/blackhole.md index 49eda79f..59068325 100644 --- a/docs/ru/config/outbounds/blackhole.md +++ b/docs/ru/config/outbounds/blackhole.md @@ -12,7 +12,7 @@ Blackhole - это протокол исходящих данных, котор { // ... "protocol": "blackhole", - // [!code focus:5] + // [!field focus] "settings": { "response": { "type": "none" diff --git a/docs/ru/config/outbounds/dns.md b/docs/ru/config/outbounds/dns.md index 07bc7bf6..6627d451 100644 --- a/docs/ru/config/outbounds/dns.md +++ b/docs/ru/config/outbounds/dns.md @@ -16,7 +16,7 @@ DNS — это исходящий протокол, который приним { // ... "protocol": "dns", - // [!code focus:18] + // [!field focus] "settings": { "rewriteNetwork": "udp", "rewriteAddress": "1.1.1.1", diff --git a/docs/ru/config/outbounds/freedom.md b/docs/ru/config/outbounds/freedom.md index d86c73c1..0b297573 100644 --- a/docs/ru/config/outbounds/freedom.md +++ b/docs/ru/config/outbounds/freedom.md @@ -16,7 +16,7 @@ Freedom — это протокол прямого исходящего подк { // ... "protocol": "freedom", - // [!code focus:28] + // [!field focus] "settings": { "redirect": "127.0.0.1:3366", "userLevel": 0, diff --git a/docs/ru/config/outbounds/http.md b/docs/ru/config/outbounds/http.md index e1b5be7a..32eb6c05 100644 --- a/docs/ru/config/outbounds/http.md +++ b/docs/ru/config/outbounds/http.md @@ -20,7 +20,7 @@ { // ... "protocol": "http", - // [!code focus:12] + // [!field focus] "settings": { "address": "192.168.108.1", "port": 3128, diff --git a/docs/ru/config/outbounds/hysteria.md b/docs/ru/config/outbounds/hysteria.md index 9cb0c509..c91c6a09 100644 --- a/docs/ru/config/outbounds/hysteria.md +++ b/docs/ru/config/outbounds/hysteria.md @@ -18,7 +18,7 @@ { // ... "protocol": "hysteria", - // [!code focus:5] + // [!field focus] "settings": { "version": 2, "address": "192.168.108.1", diff --git a/docs/ru/config/outbounds/loopback.md b/docs/ru/config/outbounds/loopback.md index ad8e10bc..2ff4f7b5 100644 --- a/docs/ru/config/outbounds/loopback.md +++ b/docs/ru/config/outbounds/loopback.md @@ -27,7 +27,7 @@ Loopback — это outbound с возвратом трафика, которы { // ... "protocol": "loopback", - // [!code focus:4] + // [!field focus] "settings": { "inboundTag": "TagUseAsInbound", "sniffing": {} diff --git a/docs/ru/config/outbounds/shadowsocks.md b/docs/ru/config/outbounds/shadowsocks.md index 886afe9b..6bbf7c11 100644 --- a/docs/ru/config/outbounds/shadowsocks.md +++ b/docs/ru/config/outbounds/shadowsocks.md @@ -32,7 +32,7 @@ { // ... "protocol": "shadowsocks", - // [!code focus:8] + // [!field focus] "settings": { "email": "love@xray.com", "address": "127.0.0.1", diff --git a/docs/ru/config/outbounds/socks.md b/docs/ru/config/outbounds/socks.md index a586311f..501a097f 100644 --- a/docs/ru/config/outbounds/socks.md +++ b/docs/ru/config/outbounds/socks.md @@ -16,7 +16,7 @@ { // ... "protocol": "socks", - // [!code focus:8] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 1234, diff --git a/docs/ru/config/outbounds/trojan.md b/docs/ru/config/outbounds/trojan.md index 34e8e27d..fdecb5fc 100644 --- a/docs/ru/config/outbounds/trojan.md +++ b/docs/ru/config/outbounds/trojan.md @@ -12,7 +12,7 @@ { // ... "protocol": "trojan", - // [!code focus:7] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 1234, diff --git a/docs/ru/config/outbounds/vless.md b/docs/ru/config/outbounds/vless.md index e0bdade3..859bd466 100644 --- a/docs/ru/config/outbounds/vless.md +++ b/docs/ru/config/outbounds/vless.md @@ -14,7 +14,7 @@ VLESS - это легкий транспортный протокол без с { // ... "protocol": "vless", - // [!code focus:9] + // [!field focus] "settings": { "address": "example.com", "port": 443, diff --git a/docs/ru/config/outbounds/vmess.md b/docs/ru/config/outbounds/vmess.md index 1b8cbea8..aff7e6eb 100644 --- a/docs/ru/config/outbounds/vmess.md +++ b/docs/ru/config/outbounds/vmess.md @@ -16,7 +16,7 @@ VMess полагается на системное время. Убедитес { // ... "protocol": "vmess", - // [!code focus:8] + // [!field focus] "settings": { "address": "127.0.0.1", "port": 37192, diff --git a/docs/ru/config/outbounds/wireguard.md b/docs/ru/config/outbounds/wireguard.md index 5d93b459..3d26f576 100644 --- a/docs/ru/config/outbounds/wireguard.md +++ b/docs/ru/config/outbounds/wireguard.md @@ -16,7 +16,7 @@ { // ... "protocol": "wireguard", - // [!code focus:20] + // [!field focus] "settings": { "secretKey": "CLIENT_PRIVATE_KEY", "address": ["10.0.0.1", "fd59:7153:2388:b5fd:0000:0000:0000:0001"], diff --git a/docs/ru/config/transport.md b/docs/ru/config/transport.md index b65a19dc..ba526bba 100644 --- a/docs/ru/config/transport.md +++ b/docs/ru/config/transport.md @@ -24,7 +24,7 @@ "outbounds": [ { // ... - // [!code focus:18] + // [!field focus] "streamSettings": { // Способы передачи "method": "raw", diff --git a/docs/ru/config/transports/finalmask.md b/docs/ru/config/transports/finalmask.md index 0d9a4473..b842cced 100644 --- a/docs/ru/config/transports/finalmask.md +++ b/docs/ru/config/transports/finalmask.md @@ -15,7 +15,7 @@ FinalMask добавляет последний слой маскировки п { // ... "streamSettings": { - // [!code focus:33] + // [!field focus] "finalmask": { "tcp": [ { @@ -62,7 +62,7 @@ FinalMask добавляет последний слой маскировки п ```json { "finalmask": { - // [!code focus:6] + // [!field focus] "tcp": [ { "type": "", @@ -88,7 +88,7 @@ FinalMask добавляет последний слой маскировки п ```json { "type": "header-custom", - // [!code focus:35] + // [!field focus] "settings": { "clients": [ [ @@ -142,7 +142,7 @@ FinalMask добавляет последний слой маскировки п ```json { "type": "fragment", - // [!code focus:6] + // [!field focus] "settings": { "packets": "tlshello", "lengths": ["3-5", "6-8", "10-20"], @@ -175,7 +175,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "sudoku", - // [!code focus:10] + // [!field focus] "settings": { "password": "", "ascii": "", @@ -198,7 +198,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "finalmask": { - // [!code focus:6] + // [!field focus] "udp": [ { "type": "", @@ -226,7 +226,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "header-custom", - // [!code focus:18] + // [!field focus] "settings": { "client": [ { @@ -261,7 +261,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "mkcp-legacy", - // [!code focus:4] + // [!field focus] "settings": { "header": "", // dns dtls srtp utp wechat wireguard "value": "" // password domain @@ -292,7 +292,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "noise", - // [!code focus:12] + // [!field focus] "settings": { "reset": "30-60", "noise": [ @@ -327,7 +327,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "salamander", - // [!code focus:4] + // [!field focus] "settings": { "password": "your-password", "packetSize": "512-1200" @@ -348,7 +348,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "sudoku", - // [!code focus:10] + // [!field focus] "settings": { "password": "", "ascii": "", @@ -379,7 +379,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "xdns", - // [!code focus:4] + // [!field focus] "settings": { "domains": ["t.example.com"], "resolvers": ["t.example.com+udp://8.8.8.8:53"] @@ -398,7 +398,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "xicmp", - // [!code focus:4] + // [!field focus] "settings": { "dgram": false, // optional "ips": [] // optional @@ -417,7 +417,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "type": "realm", - // [!code focus:8] + // [!field focus] "settings": { "url": "realm://public@xxx/your-realm-name", "stunServers": [ @@ -442,7 +442,7 @@ n-й элемент массива задаёт, сколько ждать по ```json { "finalmask": { - // [!code focus:19] + // [!field focus] "quicParams": { "congestion": "force-brutal", "bbrProfile": "standard", diff --git a/docs/ru/config/transports/grpc.md b/docs/ru/config/transports/grpc.md index 6cbb587c..c673e6e5 100644 --- a/docs/ru/config/transports/grpc.md +++ b/docs/ru/config/transports/grpc.md @@ -48,7 +48,7 @@ gRPC (HTTP/2) имеет встроенное мультиплексирован // ... "streamSettings": { "method": "grpc", - // [!code focus:10] + // [!field focus] "grpcSettings": { "authority": "grpc.example.com", "serviceName": "name", diff --git a/docs/ru/config/transports/httpupgrade.md b/docs/ru/config/transports/httpupgrade.md index b6e0e9c9..72a9fe28 100644 --- a/docs/ru/config/transports/httpupgrade.md +++ b/docs/ru/config/transports/httpupgrade.md @@ -20,7 +20,7 @@ // ... "streamSettings": { "method": "httpupgrade", - // [!code focus:8] + // [!field focus] "httpupgradeSettings": { "acceptProxyProtocol": false, "path": "/", diff --git a/docs/ru/config/transports/hysteria.md b/docs/ru/config/transports/hysteria.md index f463b511..2bb19f3e 100644 --- a/docs/ru/config/transports/hysteria.md +++ b/docs/ru/config/transports/hysteria.md @@ -14,7 +14,7 @@ // ... "streamSettings": { "method": "hysteria", - // [!code focus:17] + // [!field focus] "hysteriaSettings": { "version": 2, "auth": "password", diff --git a/docs/ru/config/transports/mkcp.md b/docs/ru/config/transports/mkcp.md index 374d2e1e..75f6540e 100644 --- a/docs/ru/config/transports/mkcp.md +++ b/docs/ru/config/transports/mkcp.md @@ -20,7 +20,7 @@ mKCP жертвует пропускной способностью ради у // ... "streamSettings": { "method": "mkcp", - // [!code focus:9] + // [!field focus] "kcpSettings": { "mtu": 1350, "tti": 20, diff --git a/docs/ru/config/transports/raw.md b/docs/ru/config/transports/raw.md index 6e468cb5..5947c873 100644 --- a/docs/ru/config/transports/raw.md +++ b/docs/ru/config/transports/raw.md @@ -16,7 +16,7 @@ // ... "streamSettings": { "method": "raw", - // [!code focus:6] + // [!field focus] "rawSettings": { "acceptProxyProtocol": false, "header": { diff --git a/docs/ru/config/transports/reality.md b/docs/ru/config/transports/reality.md index d9b4efd6..f25065ca 100644 --- a/docs/ru/config/transports/reality.md +++ b/docs/ru/config/transports/reality.md @@ -26,7 +26,7 @@ REALITY модифицирует только TLS. На стороне клие // ... "streamSettings": { "security": "reality", - // [!code focus:30] + // [!field focus] "realitySettings": { // Входящие настройки (сервер) "show": false, diff --git a/docs/ru/config/transports/sockopt.md b/docs/ru/config/transports/sockopt.md index 49758ed6..4f222b29 100644 --- a/docs/ru/config/transports/sockopt.md +++ b/docs/ru/config/transports/sockopt.md @@ -15,7 +15,7 @@ Sockopt используется для настройки низкоуровн { // ... "streamSettings": { - // [!code focus:21] + // [!field focus] "sockopt": { "mark": 0, "tcpMaxSeg": 1440, diff --git a/docs/ru/config/transports/tls.md b/docs/ru/config/transports/tls.md index 4c7686f3..6a1330a5 100644 --- a/docs/ru/config/transports/tls.md +++ b/docs/ru/config/transports/tls.md @@ -18,7 +18,7 @@ TLS — это обычный механизм защиты транспорта // ... "streamSettings": { "security": "tls", - // [!code focus:20] + // [!field focus] "tlsSettings": { "serverName": "xray.com", "verifyPeerCertByName": "", diff --git a/docs/ru/config/transports/websocket.md b/docs/ru/config/transports/websocket.md index f9abd268..078b758d 100644 --- a/docs/ru/config/transports/websocket.md +++ b/docs/ru/config/transports/websocket.md @@ -24,7 +24,7 @@ WebSocket распознает заголовок X-Forwarded-For в HTTP-зап // ... "streamSettings": { "method": "websocket", - // [!code focus:9] + // [!field focus] "wsSettings": { "acceptProxyProtocol": false, "path": "/",