Last active
June 18, 2021 07:45
-
-
Save PMExtra/73f9dc33cba869184f74fc6a47e8c2e9 to your computer and use it in GitHub Desktop.
[Xray configuration schema] Work in progress. Updated at 2021-04-29 for Xray-core v1.4.2, also compatiable with v2ray.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"$ref": "#/definitions/ConfigObject", | |
"$comment": "Work in progress, Updated at 2021-04-29 for Xray-core v1.4.2", | |
"definitions": { | |
"ConfigObject": { | |
"title": "Xray 配置", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"$schema": { | |
"type": "string", | |
"format": "uri-reference" | |
}, | |
"log": { | |
"$ref": "#/definitions/LogObject" | |
}, | |
"api": { | |
"$ref": "#/definitions/ApiObject" | |
}, | |
"dns": { | |
"$ref": "#/definitions/DnsObject" | |
}, | |
"routing": { | |
"$ref": "#/definitions/RoutingObject" | |
}, | |
"policy": { | |
"$ref": "#/definitions/PolicyObject" | |
}, | |
"inbounds": { | |
"title": "入站连接", | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/InboundObject" | |
} | |
}, | |
"outbounds": { | |
"title": "出站连接", | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/OutboundObject" | |
} | |
}, | |
"transport": { | |
"$ref": "#/definitions/TransportObject" | |
}, | |
"stats": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"reverse": { | |
"$ref": "#/definitions/ReverseObject" | |
}, | |
"fakedns": { | |
"$ref": "#/definitions/FakeDnsObject" | |
} | |
}, | |
"examples": [ | |
{ | |
"log": {}, | |
"api": {}, | |
"dns": {}, | |
"routing": {}, | |
"policy": {}, | |
"inbounds": [], | |
"outbounds": [], | |
"transport": {}, | |
"stats": {}, | |
"reverse": {}, | |
"fakedns": {} | |
} | |
] | |
}, | |
"LogObject": { | |
"title": "日志配置", | |
"description": "控制 Xray 输出日志的方式。", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"access": { | |
"title": "访问日志的文件地址", | |
"description": "当此项不指定或为空值时,表示将日志输出至 stdout 。特殊值 none ,即关闭访问日志。", | |
"type": "string", | |
"examples": [ | |
"/var/log/Xray/access.log", | |
"C:\\Temp\\Xray\\_access.log", | |
"none" | |
] | |
}, | |
"error": { | |
"title": "错误日志的文件地址", | |
"description": "当此项不指定或为空值时,表示将日志输出至 stdout 。特殊值 none ,即关闭错误日志。", | |
"type": "string", | |
"examples": [ | |
"/var/log/Xray/error.log", | |
"C:\\Temp\\Xray\\_error.log", | |
"none" | |
] | |
}, | |
"loglevel": { | |
"title": "错误日志的级别", | |
"description": "指示错误日志需要记录的信息。", | |
"enum": ["debug", "info", "warning", "error", "none"], | |
"default": "warning" | |
}, | |
"dnsLog": { | |
"title": "是否启用 DNS 查询日志", | |
"type": "boolean", | |
"default": false | |
} | |
}, | |
"examples": [ | |
{ | |
"access": "文件地址", | |
"error": "文件地址", | |
"loglevel": "warning", | |
"dnsLog": false | |
} | |
] | |
}, | |
"ApiObject": { | |
"title": "API 接口配置", | |
"description": "API 接口配置提供了一些基于 gRPC 的 API 接口供远程调用。", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"tag": { | |
"title": "出站代理标识", | |
"type": "string" | |
}, | |
"services": { | |
"title": "支持的 API 列表", | |
"type": "array", | |
"items": { | |
"enum": ["HandlerService", "LoggerService", "StatsService"] | |
}, | |
"examples": [["HandlerService", "LoggerService", "StatsService"]] | |
} | |
}, | |
"examples": [ | |
{ | |
"tag": "api", | |
"services": ["HandlerService", "LoggerService", "StatsService"] | |
} | |
] | |
}, | |
"DnsObject": { | |
"title": "DNS 配置", | |
"description": "内置的 DNS 服务器. 如果没有配置此项,则使用系统的 DNS 设置。", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"hosts": { | |
"title": "静态 IP 列表", | |
"type": "object", | |
"additionalProperties": { | |
"anyOf": [ | |
{ "type": "string", "format": "ipv4" }, | |
{ "type": "string", "format": "ipv6" }, | |
{ "type": "string", "format": "hostname" }, | |
{ "type": "string", "format": "idn-hostname" } | |
] | |
}, | |
"examples": [ | |
{ | |
"baidu.com": "127.0.0.1" | |
} | |
] | |
}, | |
"servers": { | |
"title": "DNS 服务器列表", | |
"description": "支持 DNS 地址 (字符串形式) 和 ServerObject 。", | |
"type": "array", | |
"items": { | |
"anyOf": [ | |
{ "$ref": "#/definitions/DnsAddress" }, | |
{ "$ref": "#/definitions/ServerObject" } | |
] | |
} | |
}, | |
"clientIp": { | |
"title": "客户端 IP", | |
"description": "用于 DNS 查询时通知服务器以指定 IP 位置。不能是私有地址。", | |
"anyOf": [ | |
{ "type": "string", "format": "ipv4" }, | |
{ "type": "string", "format": "ipv6" } | |
], | |
"examples": ["1.2.3.4"] | |
}, | |
"tag": { | |
"title": "DNS 代理标识", | |
"type": "string", | |
"examples": ["dns_inbound"] | |
} | |
}, | |
"examples": [ | |
{ | |
"hosts": { | |
"baidu.com": "127.0.0.1" | |
}, | |
"servers": [ | |
"8.8.8.8", | |
"8.8.4.4", | |
{ | |
"address": "1.2.3.4", | |
"port": 5353, | |
"domains": ["domain:xray.com"], | |
"expectIPs": ["geoip:cn"] | |
}, | |
"localhost" | |
], | |
"clientIp": "1.2.3.4", | |
"tag": "dns_inbound" | |
} | |
] | |
}, | |
"DnsAddress": { | |
"title": "DNS 服务器地址", | |
"anyOf": [ | |
{ "const": "localhost" }, | |
{ "const": "fakedns" }, | |
{ "type": "string", "format": "ipv4" }, | |
{ "type": "string", "format": "ipv6" }, | |
{ "type": "string", "format": "uri" }, | |
{ "type": "string", "format": "iri" } | |
], | |
"examples": [ | |
"8.8.8.8", | |
"https://dns.google/dns-query", | |
"https+local://dns.google/dns-query", | |
"localhost", | |
"fakedns" | |
] | |
}, | |
"ServerObject": { | |
"title": "DNS 服务器", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"address": { | |
"$ref": "#/definitions/DnsAddress" | |
}, | |
"domains": { | |
"title": "域名匹配列表", | |
"description": "此列表包含的域名,将优先使用此服务器进行查询。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"examples": ["domain:xray.com", "geosite:google", "geosite:cn"] | |
}, | |
"expectIPs": { | |
"title": "IP 范围列表", | |
"description": "当配置此项时,Xray DNS 会对返回的 IP 的进行校验,只返回此列表中包含的地址。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"examples": ["geoip:cn"] | |
}, | |
"port": { | |
"title": "DNS 服务器端口" | |
} | |
}, | |
"anyOf": [ | |
{ | |
"properties": { | |
"address": { | |
"anyOf": [{ "format": "ipv4" }, { "format": "ipv6" }] | |
}, | |
"port": { | |
"type": "integer", | |
"default": 53, | |
"minimum": 1, | |
"maximum": 65535 | |
} | |
} | |
}, | |
{ | |
"$comment": "该配置在 vscode 中暂时无效,详见 microsoft/vscode#123447 。", | |
"properties": { | |
"port": { | |
"description": "当使用 DOH 模式该项无效,非标端口应在 URL 中指定。", | |
"const": null | |
} | |
} | |
} | |
], | |
"required": ["address"] | |
}, | |
"RoutingObject": { | |
"title": "路由功能配置", | |
"description": "可以将入站数据按不同规则由不同的出站连接发出,以达到按需代理的目的。", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"domainStrategy": { | |
"title": "域名解析策略", | |
"enum": ["AsIs", "IPIfNonMatch", "IPOnDemand"], | |
"default": "AsIs" | |
}, | |
"rules": { | |
"title": "规则列表", | |
"description": "对于每一个连接,路由将根据这些规则依次进行判断,当一个规则生效时,即将这个连接转发至它所指定的 outboundTag 或 balancerTag 。", | |
"type": "array", | |
"items": { "$ref": "#/definitions/RuleObject" }, | |
"examples": [ | |
[ | |
{ | |
"type": "field", | |
"domain": ["baidu.com", "qq.com", "geosite:cn"], | |
"ip": [ | |
"0.0.0.0/8", | |
"10.0.0.0/8", | |
"fc00::/7", | |
"fe80::/10", | |
"geoip:cn" | |
], | |
"port": "53,443,1000-2000", | |
"sourcePort": "53,443,1000-2000", | |
"network": "tcp", | |
"source": ["10.0.0.1"], | |
"user": ["[email protected]"], | |
"inboundTag": ["tag-vmess"], | |
"protocol": ["http", "tls", "bittorrent"], | |
"attrs": "attrs[':method'] == 'GET'", | |
"outboundTag": "direct", | |
"balancerTag": "balancer" | |
} | |
] | |
] | |
}, | |
"balancers": { | |
"title": "负载均衡器列表", | |
"description": "当一个规则指向一个负载均衡器时,Xray 会通过此负载均衡器选出一个 outbound, 然后由它转发流量。", | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/BalancerObject" | |
} | |
} | |
}, | |
"examples": [ | |
{ | |
"domainStrategy": "AsIs", | |
"rules": [], | |
"balancers": [] | |
} | |
] | |
}, | |
"RuleObject": { | |
"title": "路由规则", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"type": { | |
"const": "field", | |
"default": "field" | |
}, | |
"domain": { | |
"title": "域名匹配列表", | |
"description": "当某一项匹配目标域名时,此规则生效。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"ip": { | |
"title": "目标 IP 匹配列表", | |
"description": "当某一项匹配目标 IP 时,此规则生效。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"port": { | |
"title": "目标端口", | |
"anyOf": [ | |
{ "type": "number", "minimum": 1, "maximum": 65535 }, | |
{ | |
"type": "string", | |
"pattern": "^\\d+\\-\\d+$", | |
"$comment": "为了简化正则,此处不进行数值范围校验,下同" | |
}, | |
{ | |
"type": "string", | |
"pattern": "^(\\d+|\\d+\\-\\d+)(,(\\d+|\\d+\\-\\d+))*$" | |
} | |
] | |
}, | |
"sourcePort": { | |
"title": "来源端口", | |
"anyOf": [ | |
{ "type": "number", "minimum": 1, "maximum": 65535 }, | |
{ | |
"type": "string", | |
"pattern": "^\\d+\\-\\d+$" | |
}, | |
{ | |
"type": "string", | |
"pattern": "^(\\d+|\\d+\\-\\d+)(,(\\d+|\\d+\\-\\d+))*$" | |
} | |
] | |
}, | |
"network": { | |
"title": "网络协议匹配", | |
"description": "当连接方式是指定的方式时,此规则生效。", | |
"enum": ["tcp", "udp", "tcp,udp"] | |
}, | |
"source": { | |
"title": "来源 IP 匹配列表", | |
"description": "当某一项匹配来源 IP 时,此规则生效。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"user": { | |
"title": "用户匹配列表", | |
"description": "当某一项匹配来源用户时,此规则生效。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"inboundTag": { | |
"title": "入站标识匹配列表", | |
"description": "当某一项匹配入站协议的标识时,此规则生效。", | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"protocol": { | |
"title": "应用协议匹配", | |
"description": "当某一个协议匹配当前连接的协议类型时,此规则生效。", | |
"type": "array", | |
"items": { | |
"enum": ["http", "tls", "bittorrent"] | |
} | |
}, | |
"attrs": { | |
"title": "属性匹配列表", | |
"type": "string" | |
}, | |
"outboundTag": { | |
"title": "指定出站连接的标识", | |
"description": "balancerTag 和 outboundTag 须二选一。", | |
"type": "string" | |
}, | |
"balancerTag": { | |
"title": "指定负载均衡的标识", | |
"description": "balancerTag 和 outboundTag 须二选一。", | |
"type": "string" | |
} | |
}, | |
"oneOf": [ | |
{ | |
"required": ["outboundTag"] | |
}, | |
{ | |
"required": ["balancerTag"] | |
} | |
], | |
"required": ["type"], | |
"examples": [ | |
{ | |
"type": "field", | |
"domain": ["baidu.com", "qq.com", "geosite:cn"], | |
"ip": [ | |
"0.0.0.0/8", | |
"10.0.0.0/8", | |
"fc00::/7", | |
"fe80::/10", | |
"geoip:cn" | |
], | |
"port": "53,443,1000-2000", | |
"sourcePort": "53,443,1000-2000", | |
"network": "tcp", | |
"source": ["10.0.0.1"], | |
"user": ["[email protected]"], | |
"inboundTag": ["tag-vmess"], | |
"protocol": ["http", "tls", "bittorrent"], | |
"attrs": "attrs[':method'] == 'GET'", | |
"outboundTag": "direct", | |
"balancerTag": "balancer" | |
} | |
] | |
}, | |
"BalancerObject": { | |
"title": "负载均衡器", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"tag": { | |
"title": "负载均衡器标识", | |
"description": "用于匹配 RuleObject 中的 balancerTag 。", | |
"type": "string" | |
}, | |
"selector": { | |
"title": "匹配列表", | |
"description": "一个字符串数组,其中每一个字符串将用于和 outbound 标识的前缀匹配。", | |
"type": "array", | |
"items": { "type": "string" } | |
} | |
}, | |
"examples": [ | |
{ | |
"tag": "balancer", | |
"selector": [] | |
} | |
] | |
}, | |
"PolicyObject": { | |
"title": "本地策略配置", | |
"description": "可以设置不同的用户等级和对应的策略设置,比如连接超时设置。Xray 处理的每一个连接都对应一个用户,按照用户的等级(level)应用不同的策略。", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"levels": { | |
"title": "用户等级策略组", | |
"description": "一个键值对,每个键是一个字符串形式的数字,比如 \"0\"、\"1\" 等,双引号不能省略,此数字对应用户等级。", | |
"additionalProperties": { | |
"$ref": "#/definitions/LevelPolicyObject" | |
} | |
}, | |
"system": { | |
"$ref": "#/definitions/SystemPolicyObject" | |
} | |
}, | |
"examples": [ | |
{ | |
"levels": { | |
"0": { | |
"handshake": 4, | |
"connIdle": 300, | |
"uplinkOnly": 2, | |
"downlinkOnly": 5, | |
"statsUserUplink": false, | |
"statsUserDownlink": false, | |
"bufferSize": 4 | |
} | |
}, | |
"system": { | |
"statsInboundUplink": false, | |
"statsInboundDownlink": false, | |
"statsOutboundUplink": false, | |
"statsOutboundDownlink": false | |
} | |
} | |
] | |
}, | |
"LevelPolicyObject": { | |
"title": "用户等级策略", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"handshake": { | |
"title": "连接建立时的握手时间限制", | |
"description": "单位为秒。在入站代理处理一个新连接时,在握手阶段如果使用的时间超过这个时间,则中断该连接。", | |
"type": "integer", | |
"default": 4 | |
}, | |
"connIdle": { | |
"title": "连接空闲的时间限制", | |
"description": "单位为秒。inbound/outbound 处理一个连接时,如果在 connIdle 时间内,没有任何数据被传输(包括上行和下行数据),则中断该连接。", | |
"type": "integer", | |
"default": 300 | |
}, | |
"uplinkOnly": { | |
"title": "连接下行线路关闭后的时间限制", | |
"description": "单位为秒。当服务器(如远端网站)关闭下行连接时,出站代理会在等待 uplinkOnly 时间后中断连接。", | |
"type": "integer", | |
"default": 2 | |
}, | |
"downlinkOnly": { | |
"title": "连接上行线路关闭后的时间限制", | |
"description": "单位为秒。当客户端(如浏览器)关闭上行连接时,入站代理会在等待 downlinkOnly 时间后中断连接。", | |
"type": "integer", | |
"default": 5 | |
}, | |
"statsUserUplink": { | |
"title": "上行流量统计", | |
"description": "当值为 true 时,开启当前等级的所有用户的上行流量统计。", | |
"type": "boolean" | |
}, | |
"statsUserDownlink": { | |
"title": "下行流量统计", | |
"description": "当值为 true 时,开启当前等级的所有用户的下行流量统计。", | |
"type": "boolean" | |
}, | |
"bufferSize": { | |
"title": "每个连接的内部缓存大小", | |
"description": "单位为 kB。当值为 0 时,内部缓存被禁用。", | |
"type": "integer" | |
} | |
}, | |
"examples": [ | |
{ | |
"handshake": 4, | |
"connIdle": 300, | |
"uplinkOnly": 2, | |
"downlinkOnly": 5, | |
"statsUserUplink": false, | |
"statsUserDownlink": false, | |
"bufferSize": 10240 | |
} | |
] | |
}, | |
"SystemPolicyObject": { | |
"title": "系统级别策略", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"statsInboundUplink": { | |
"title": "入站代理上行流量统计", | |
"description": "当值为 true 时,开启所有入站代理的上行流量统计。", | |
"type": "boolean" | |
}, | |
"statsInboundDownlink": { | |
"title": "入站代理下行流量统计", | |
"description": "当值为 true 时,开启所有入站代理的下行流量统计。", | |
"type": "boolean" | |
}, | |
"statsOutboundUplink": { | |
"title": "出站代理上行流量统计", | |
"description": "当值为 true 时,开启所有出站代理的上行流量统计。", | |
"type": "boolean" | |
}, | |
"statsOutboundDownlink": { | |
"title": "出站代理下行流量统计", | |
"description": "当值为 true 时,开启所有出站代理的下行流量统计。", | |
"type": "boolean" | |
} | |
}, | |
"examples": [ | |
{ | |
"statsInboundUplink": false, | |
"statsInboundDownlink": false, | |
"statsOutboundUplink": false, | |
"statsOutboundDownlink": false | |
} | |
] | |
}, | |
"InboundObject": { | |
"title": "入站连接配置", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"listen": { | |
"title": "监听地址", | |
"description": "IP 地址或 Unix domain socket", | |
"type": "string", | |
"default": "0.0.0.0", | |
"examples": ["127.0.0.1", "/dev/shm/domain.socket"] | |
}, | |
"port": { | |
"title": "监听端口", | |
"description": "当只有一个端口时,Xray 会在此端口监听入站连接。当指定了一个端口范围时,取决于 allocate 设置。", | |
"oneOf": [ | |
{ | |
"type": "number", | |
"minimum": 1, | |
"maximum": 65535 | |
}, | |
{ | |
"type": "string", | |
"oneOf": [ | |
{ "pattern": "^env:.+" }, | |
{ "pattern": "^\\d+$" }, | |
{ "pattern": "^\\d+\\-\\d+?$" } | |
] | |
} | |
] | |
}, | |
"protocol": { | |
"title": "连接协议", | |
"enum": [ | |
"dokodemo-door", | |
"http", | |
"socks", | |
"vless", | |
"vmess", | |
"trojan", | |
"shadowsocks" | |
] | |
}, | |
"settings": { | |
"type": "object" | |
}, | |
"streamSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"tag": { | |
"title": "入站连接的标识", | |
"description": "用于在其它的配置中定位此连接。", | |
"type": "string" | |
}, | |
"sniffing": { | |
"$ref": "#/definitions/Sniffing" | |
}, | |
"allocate": { | |
"$ref": "#/definitions/Allocate" | |
} | |
}, | |
"required": ["protocol"], | |
"anyOf": [ | |
{ | |
"properties": { | |
"protocol": { | |
"const": "dokodemo-door" | |
}, | |
"settings": { | |
"$ref": "#/definitions/DokodemoDoorInboundConfigurationObject" | |
} | |
} | |
}, | |
{ | |
"properties": { | |
"protocol": { | |
"const": "http" | |
}, | |
"settings": { | |
"$ref": "#/definitions/HttpInboundConfigurationObject" | |
} | |
} | |
}, | |
{ | |
"properties": { | |
"protocol": { | |
"const": "socks" | |
}, | |
"settings": { | |
"$ref": "#/definitions/SocksInboundConfigurationObject" | |
} | |
} | |
}, | |
{ | |
"properties": { | |
"protocol": { | |
"const": "vless" | |
}, | |
"settings": { | |
"$ref": "#/definitions/VLESSInboundConfigurationObject" | |
} | |
}, | |
"required": ["settings"] | |
}, | |
{ | |
"properties": { | |
"protocol": { | |
"const": "vmess" | |
}, | |
"settings": { | |
"$ref": "#/definitions/VMessInboundConfigurationObject" | |
} | |
} | |
} | |
] | |
}, | |
"DokodemoDoorInboundConfigurationObject": { | |
"title": "任意门入站配置", | |
"description": "可以监听一个本地端口,并把所有进入此端口的数据发送至指定服务器的一个端口,从而达到端口映射的效果。", | |
"additionalProperties": false, | |
"properties": { | |
"address": { | |
"title": "转发目标地址", | |
"description": "当 followRedirect 为 true 时,address 可为空。", | |
"type": "string", | |
"anyOf": [ | |
{ "type": "string", "format": "ipv4" }, | |
{ "type": "string", "format": "ipv6" }, | |
{ "type": "string", "format": "hostname" }, | |
{ "type": "string", "format": "idn-hostname" } | |
] | |
}, | |
"port": { | |
"title": "转发目标端口", | |
"type": "integer", | |
"minimum": 1, | |
"maximum": 65535 | |
}, | |
"network": { | |
"title": "可接收的网络协议类型", | |
"enum": ["tcp", "udp", "tcp,udp"], | |
"default": "tcp" | |
}, | |
"timeout": { | |
"title": "连接空闲的时间限制", | |
"description": "单位为秒", | |
"type": "integer", | |
"default": 300 | |
}, | |
"followRedirect": { | |
"description": "当值为 true 时,dokodemo-door 会识别出由 iptables 转发而来的数据,并转发到相应的目标地址。", | |
"type": "boolean", | |
"default": false | |
}, | |
"userLevel": { | |
"title": "用户等级", | |
"description": "连接会使用这个用户等级对应的本地策略。", | |
"type": "integer", | |
"default": 0 | |
} | |
}, | |
"required": ["port"], | |
"anyOf": [ | |
{ | |
"properties": { | |
"followRedirect": { | |
"const": true | |
} | |
} | |
}, | |
{ "required": ["address"] } | |
] | |
}, | |
"HttpInboundConfigurationObject": { | |
"title": "HTTP 入站配置", | |
"description": "HTTP 入站通常用于在局域网或本机环境下监听,为其他程序提供本地服务。", | |
"additionalProperties": false, | |
"properties": { | |
"timeout": { | |
"title": "连接空闲的时间限制", | |
"description": "单位为秒", | |
"type": "integer", | |
"default": 300 | |
}, | |
"accounts": { | |
"title": "用户帐号列表", | |
"description": "当 accounts 非空时,HTTP 代理将对入站连接进行 Basic Authentication 验证。", | |
"type": "array", | |
"items": { "$ref": "#/definitions/AccountObject" }, | |
"default": [] | |
}, | |
"allowTransparent": { | |
"title": "允许透明代理", | |
"description": "当为 true 时,会转发所有 HTTP 请求,而非只是代理请求。", | |
"type": "boolean", | |
"default": false | |
}, | |
"userLevel": { | |
"title": "用户等级", | |
"description": "连接会使用这个用户等级对应的本地策略。", | |
"type": "integer", | |
"default": 0 | |
} | |
} | |
}, | |
"AccountObject": { | |
"title": "用户配置", | |
"additionalProperties": false, | |
"properties": { | |
"user": { | |
"title": "用户名", | |
"type": "string" | |
}, | |
"pass": { | |
"title": "密码", | |
"type": "string" | |
} | |
}, | |
"required": ["user", "pass"] | |
}, | |
"SocksInboundConfigurationObject": { | |
"title": "Socks 入站配置", | |
"description": "标准 Socks 协议实现,兼容 Socks 4、Socks 4a 和 Socks 5。\nSocks 入站通常用于在局域网或本机环境下监听,为其他程序提供本地服务。", | |
"additionalProperties": false, | |
"properties": { | |
"auth": { | |
"title": "认证方式", | |
"enum": ["noauth", "password"], | |
"default": "noauth" | |
}, | |
"accounts": { | |
"title": "用户账号列表" | |
} | |
}, | |
"anyOf": [ | |
{ | |
"properties": { | |
"auth": { | |
"const": "password" | |
}, | |
"accounts": { | |
"type": "array", | |
"items": { "$ref": "#/definitions/AccountObject" }, | |
"default": [] | |
} | |
}, | |
"required": ["accounts"] | |
}, | |
{ | |
"properties": { | |
"auth": { | |
"const": "noauth" | |
}, | |
"accounts": { | |
"description": "此选项仅当 auth 为 password 时有效。", | |
"const": null | |
} | |
} | |
} | |
] | |
}, | |
"VLESSInboundConfigurationObject": { | |
"title": "VLESS 入站配置", | |
"description": "一个无状态的轻量传输协议,可以作为 Xray 客户端和服务器之间的桥梁。\n目前 VLESS 没有自带加密,请用于可靠信道,如 TLS。 目前 VLESS 不支持分享。", | |
"properties": { | |
"clients": { | |
"title": "用户列表", | |
"description": "代表一组服务端认可的用户。", | |
"type": "array", | |
"items": { "$ref": "#/definitions/VLESSClientObject" }, | |
"default": [] | |
}, | |
"decryption": { | |
"title": "解密方式", | |
"description": "现阶段需要填 \"none\",不能留空。\n若未正确设置 decryption 的值,使用 Xray 或 -test 时会收到错误信息。", | |
"const": "none" | |
}, | |
"fallbacks": { | |
"title": "回落分流配置", | |
"description": "包含一系列强大的回落分流配置(可选)。", | |
"type": "array", | |
"items": { "$ref": "#/definitions/VLESSFallbackObject" } | |
} | |
}, | |
"required": ["decryption"] | |
}, | |
"VLESSClientObject": { | |
"title": "VLESS 用户配置", | |
"properties": { | |
"id": { | |
"title": "VLESS 的用户 ID", | |
"description": "可以是任意小于 30 字节的字符串,也可以是一个合法的 UUID 。\n自定义字符串和其映射的 UUID 是等价的,你可以使用命令 xray uuid -i \"自定义字符串\" 生成自定义字符串所映射的的 UUID。", | |
"anyOf": [ | |
{ | |
"type": "string", | |
"minLength": 1, | |
"maxLength": 30 | |
}, | |
{ | |
"type": "string", | |
"minLength": 36, | |
"maxLength": 36 | |
} | |
] | |
}, | |
"level": { | |
"title": "用户等级", | |
"description": "连接会使用这个用户等级对应的本地策略。", | |
"type": "integer", | |
"default": 0 | |
}, | |
"email": { | |
"title": "用户邮箱", | |
"description": "用于区分不同用户的流量(会体现在日志、统计中)。", | |
"type": "string", | |
"format": "email" | |
}, | |
"flow": { | |
"title": "流控模式", | |
"enum": ["xtls-rprx-origin", "xtls-rprx-direct"] | |
} | |
}, | |
"required": ["id"] | |
}, | |
"VLESSFallbackObject": { | |
"title": "Fallback 回落配置", | |
"properties": { | |
"name": { | |
"title": "域名匹配", | |
"description": "尝试匹配 TLS SNI (Server Name Indication),空为任意。", | |
"type": "string", | |
"default": "" | |
}, | |
"alpn": { | |
"title": "ALPN 协商匹配", | |
"description": "尝试匹配 TLS ALPN 协商结果,空为任意。", | |
"type": "string", | |
"default": "" | |
}, | |
"path": { | |
"title": "HTTP 路径匹配", | |
"description": "尝试匹配首包 HTTP PATH,空为任意。非空则必须以 / 开头,不支持 h2c 。", | |
"type": "string", | |
"default": "" | |
}, | |
"dest": { | |
"title": "流量去向", | |
"description": "决定 TLS 解密后 TCP 流量的去向。", | |
"anyOf": [ | |
{ | |
"type": "string" | |
}, | |
{ | |
"type": "integer", | |
"minimum": 1, | |
"maximum": 65535 | |
} | |
] | |
}, | |
"xver": { | |
"title": "PROXY protocol 版本", | |
"description": "专用于传递请求的真实来源 IP 和端口,填版本 1 或 2,默认为 0,即不发送。", | |
"enum": [0, 1, 2], | |
"default": 0 | |
} | |
}, | |
"required": ["dest"] | |
}, | |
"VMessInboundConfigurationObject": { | |
"title": "VMess 入站配置", | |
"description": "一个加密传输协议,可以作为 Xray 客户端和服务器之间的桥梁。", | |
"properties": { | |
"clients": { | |
"title": "用户列表", | |
"type": "array", | |
"items": { "$ref": "#/definitions/VMessClientObject" } | |
}, | |
"detour": { | |
"title": "绕路配置", | |
"description": "指示对应的出站协议使用另一个服务器。", | |
"type": "object", | |
"properties": { | |
"to": { | |
"title": "入站 tag", | |
"description": "一个 inbound 的 tag , 指定的 inbound 必须使用 VMess 协议。", | |
"type": "string" | |
} | |
}, | |
"required": ["to"], | |
"examples": [ | |
{ | |
"to": "tag_to_detour" | |
} | |
] | |
}, | |
"default": { | |
"title": "clients 的默认配置", | |
"description": "仅在配合 detour 时有效。" | |
}, | |
"disableInsecureEncryption": { | |
"title": "禁用不安全的加密", | |
"description": "如果设置为 true 当客户端指定下列加密方式时,服务器会主动断开连接。\n\"none\"\n\"aes-128-cfb\"", | |
"type": "boolean", | |
"default": false | |
} | |
}, | |
"anyOf": [ | |
{ | |
"properties": { | |
"default": { | |
"type": "object", | |
"properties": { | |
"level": { | |
"title": "用户等级", | |
"description": "连接会使用这个用户等级对应的本地策略。", | |
"type": "integer", | |
"default": 0 | |
}, | |
"alterId": { | |
"title": "动态 ID", | |
"description": "为了进一步防止被探测,一个用户可以在主 ID 的基础上,再额外生成多个动态 ID 。这里只需要指定动态 ID 的数量,推荐值为 0 代表启用 VMessAEAD 。", | |
"type": "integer", | |
"default": 0, | |
"minimum": 0, | |
"maximum": 65535 | |
} | |
} | |
} | |
}, | |
"required": ["detour", "default"] | |
}, | |
{ | |
"properties": { | |
"default": { | |
"const": null | |
} | |
} | |
} | |
] | |
}, | |
"VMessClientObject": { | |
"title": "VMess 用户配置", | |
"properties": { | |
"id": { | |
"title": "用户 ID", | |
"description": "可以是任意小于 30 字节的字符串,也可以是一个合法的 UUID 。\n自定义字符串和其映射的 UUID 是等价的,你可以使用命令 xray uuid -i \"自定义字符串\" 生成自定义字符串所映射的的 UUID。", | |
"type": "string", | |
"anyOf": [ | |
{ | |
"type": "string", | |
"minLength": 1, | |
"maxLength": 30 | |
}, | |
{ | |
"type": "string", | |
"minLength": 36, | |
"maxLength": 36 | |
} | |
] | |
}, | |
"level": { | |
"title": "用户等级", | |
"description": "连接会使用这个用户等级对应的本地策略。", | |
"type": "integer", | |
"default": 0 | |
}, | |
"alterId": { | |
"title": "动态 ID", | |
"description": "为了进一步防止被探测,一个用户可以在主 ID 的基础上,再额外生成多个动态 ID 。这里只需要指定动态 ID 的数量,推荐值为 0 代表启用 VMessAEAD 。", | |
"type": "integer", | |
"default": 0, | |
"minimum": 0, | |
"maximum": 65535 | |
}, | |
"email": { | |
"title": "用户邮箱", | |
"description": "用于区分不同用户的流量(会体现在日志、统计中)。", | |
"type": "string", | |
"format": "email" | |
} | |
} | |
}, | |
"OutboundObject": { | |
"title": "出站连接配置", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"sendThrough": { | |
"type": "string" | |
}, | |
"protocol": { | |
"type": "string" | |
}, | |
"settings": {}, | |
"tag": { | |
"type": "string" | |
}, | |
"streamSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"proxySettings": { | |
"$ref": "#/definitions/ProxySettings" | |
}, | |
"mux": { | |
"$ref": "#/definitions/StatsObject" | |
} | |
}, | |
"required": [ | |
"mux", | |
"protocol", | |
"proxySettings", | |
"sendThrough", | |
"settings", | |
"streamSettings", | |
"tag" | |
] | |
}, | |
"FakeDnsObject": { | |
"title": "伪造 DNS 配置", | |
"description": "FakeDNS 通过伪造 DNS 以获取目标域名,能够降低 DNS 查询时的延迟、配合透明代理获取目标域名。", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"ipPool": { | |
"title": "IP 池", | |
"description": "FakeDNS 将使用此选项指定的 IP 块分配地址。", | |
"type": "string" | |
}, | |
"poolSize": { | |
"title": "IP 池容量", | |
"description": "指定 FakeDNS 储存的 域名-IP 映射的最大数目。当映射数超过此值后,会按照 LRU 规则淘汰映射。", | |
"type": "integer", | |
"default": 65535 | |
} | |
}, | |
"required": ["ipPool"] | |
}, | |
"Allocate": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"strategy": { | |
"type": "string" | |
}, | |
"refresh": { | |
"type": "integer" | |
}, | |
"concurrency": { | |
"type": "integer" | |
} | |
}, | |
"required": ["concurrency", "refresh", "strategy"], | |
"title": "Allocate" | |
}, | |
"StatsObject": { | |
"type": "object", | |
"additionalProperties": false, | |
"title": "Stats" | |
}, | |
"Sniffing": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"enabled": { | |
"type": "boolean" | |
}, | |
"destOverride": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
}, | |
"required": ["destOverride", "enabled"], | |
"title": "Sniffing" | |
}, | |
"ProxySettings": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"tag": { | |
"type": "string" | |
} | |
}, | |
"required": ["tag"], | |
"title": "ProxySettings" | |
}, | |
"ReverseObject": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"bridges": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Bridge" | |
} | |
}, | |
"portals": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/Bridge" | |
} | |
} | |
}, | |
"required": ["bridges", "portals"], | |
"title": "Reverse" | |
}, | |
"Bridge": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"tag": { | |
"type": "string" | |
}, | |
"domain": { | |
"type": "string" | |
} | |
}, | |
"required": ["domain", "tag"], | |
"title": "Bridge" | |
}, | |
"TransportObject": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"tcpSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"kcpSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"wsSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"httpSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"quicSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"dsSettings": { | |
"$ref": "#/definitions/StatsObject" | |
}, | |
"grpcSettings": { | |
"$ref": "#/definitions/StatsObject" | |
} | |
}, | |
"required": [ | |
"dsSettings", | |
"grpcSettings", | |
"httpSettings", | |
"kcpSettings", | |
"quicSettings", | |
"tcpSettings", | |
"wsSettings" | |
], | |
"title": "Transport" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment