Skip to content

Instantly share code, notes, and snippets.

@0x-jerry
Last active December 5, 2019 05:15
Show Gist options
  • Save 0x-jerry/4e6dd96774a2ef12a989c884eebe03ab to your computer and use it in GitHub Desktop.
Save 0x-jerry/4e6dd96774a2ef12a989c884eebe03ab to your computer and use it in GitHub Desktop.
v2ray config json schema (Abandoned!!! Please use https://github.com/cwxyz007/v2ray-config-json-schema instead)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "V2Ray",
"description": "V2Ray config",
"definitions": {
"account": {
"type": "object",
"properties": {
"user": {
"type": "string",
"description": "用户名"
},
"pass": {
"type": "string",
"description": "密码"
}
}
},
"protocol": {
"type": "string",
"description": "连接协议名称",
"enum": ["blackhole", "dns", "dokodemo-door", "freedom", "http", "mtproto", "shadowsocks", "socks", "vmess"]
},
"transportSetting": {
"type": "object",
"description": "TransportObject对应配置文件的transport项",
// todo
"properties": {
"tcpSettings": {
"type": "object",
"description": "针对 TCP 连接的配置"
},
"kcpSettings": {
"type": "object",
"description": "针对 mKCP 连接的配置"
},
"wsSettings": {
"type": "object",
"description": "针对 WebSocket 连接的配置"
},
"httpSettings": {
"type": "object",
"description": "针对 HTTP/2 连接的配置"
},
"dsSettings": {
"type": "object",
"description": "针于Domain Socket 连接的配置"
},
"quicSettings": {
"type": "object",
"description": "(V2Ray 4.7+) 针于QUIC 连接的配置"
}
}
},
"streamSettings": {
"type": "object",
"description": "底层传输方式(transport)是当前 V2Ray 节点和其它节点对接的方式。底层传输方式提供了稳定的数据传输通道。通常来说,一个网络连接的两端需要有对称的传输方式。比如一端用了 WebSocket,那么另一个端也必须使用 WebSocket,否则无法建立连接",
"allOf": [
{
"$ref": "#/definitions/transportSetting"
},
{
"properties": {
"network": {
"type": "string",
"description": "数据流所使用的网络类型,默认值为 \"tcp\"",
"enum": ["tcp", "kcp", "ws", "http", "domainsocket", "quic"]
},
"security": {
"type": "string",
"description": "是否启入传输层加密,支持的选项有 \"none\" 表示不加密(默认值),\"tls\" 表示使用 TLS",
"enum": ["none", "tls"]
},
"sockopt": {
"type": "object",
"description": "连接选项",
"properties": {
"mark": {
"type": "number",
"description": "一个整数。当其值非零时,在出站连接上标记 SO_MARK (仅适用于 Linux 系统)"
},
"tcpFastOpen": {
"type": "boolean",
"description": "是否启用 TCP Fast Open。当其值为true时,强制开启TFO;当其它为false时,强制关闭TFO;当此项不存在时,使用系统默认设置。可用于入站出站连接"
},
"tproxy": {
"type": "string",
"description": "是否开启透明代理 (仅适用于 Linux)",
"enum": ["redirect", "tproxy", "off"]
}
}
}
}
}
]
}
},
"properties": {
"log": {
"type": "object",
"description": "日志配置,表示 V2Ray 如何输出日志",
"properties": {
"access": {
"type": "string",
"description": "访问日志的文件地址,其值是一个合法的文件地址,如\"/tmp/v2ray/_access.log\"(Linux)或者\"C:\\Temp\\v2ray\\_access.log\"(Windows)。当此项不指定或为空值时,表示将日志输出至 stdout"
},
"error": {
"type": "string",
"description": "错误日志的文件地址,其值是一个合法的文件地址,如\"/tmp/v2ray/_error.log\"(Linux)或者\"C:\\Temp\\v2ray\\_error.log\"(Windows)。当此项不指定或为空值时,表示将日志输出至 stdout"
},
"loglevel": {
"type": "string",
"description": "错误日志的级别。默认值为\"warning\"",
"enum": ["debug", "info", "warning", "error", "none"]
}
}
},
"api": {
"type": "object",
"description": "内置的远程控置 API",
"properties": {
"tag": {
"type": "string",
"description": "出站代理标识"
},
"services": {
"type": "array",
"description": "开启的 API 列表",
"uniqueItems": true,
"items": {
"type": "string",
"enum": ["HandlerService", "LoggerService", "StatsService"]
}
}
}
},
"dns": {
"type": "object",
"description": "内置的 DNS 服务器,若此项不存在,则默认使用本机的 DNS 设置",
"properties": {
"hosts": {
"type": "object",
"description": "静态 IP 列表,其值为一系列的\"域名\":\"地址\"。其中地址可以是 IP 或者域名。在解析域名时,如果域名匹配这个列表中的某一项,当该项的地址为 IP 时,则解析结果为该项的 IP,而不会使用下述的 servers 进行解析;当该项的地址为域名时,会使用此域名进行 IP 解析,而不使用原始域名",
"patternProperties": {
".+": {
"type": "string",
"description": ""
}
}
},
"servers": {
"type": "array",
"description": "一个 DNS 服务器列表,支持的类型有三种:IP 地址(字符串形式),ServerObject,或者\"localhost\"",
"items": {
"oneOf": [
{
"type": "string",
"description": "IP 地址(字符串形式)"
},
{
"type": "object",
"description": "",
"properties": {
"address": {
"type": "string",
"description": "DNS 服务器地址,如\"8.8.8.8\"。目前只支持 UDP 协议的 DNS 服务器"
},
"port": {
"type": "number",
"description": "DNS 服务器端口,如53"
},
"domains": {
"type": "array",
"description": "一个域名列表,此列表包含的域名,将优先使用此服务器进行查询。域名格式和路由配置中相同",
"items": {
"type": "string",
"description": ""
}
}
}
}
]
}
},
"clientIp": {
"type": "string",
"description": "当前系统的 IP 地址,用于 DNS 查询时,通知服务器客户端的所在位置。不能是私有地址"
},
"tag": {
"type": "string",
"description": "(V2Ray 4.13+) 由此 DNS 发出的查询流量,除localhost外,都会带有此标识,可在路由使用inboundTag进行匹配"
}
}
},
"stats": {
"type": "object",
"description": "当此项存在时,开启统计信息,目前无配置"
},
"routing": {
"type": "object",
"description": "路由配置",
"properties": {
"domainStrategy": {
"type": "string",
"description": "域名解析策略,根据不同的设置使用不同的策略",
"enum": ["AsIs", "IPIfNonMatch", "IPOnDemand"]
},
"rules": {
"type": "array",
"description": "对应一个数组,数组中每个元素是一个规则。对于每一个连接,路由将根据这些规则依次进行判断,当一个规则生效时,即将这个连接转发至它所指定的outboundTag(或balancerTag,V2Ray 4.4+)。当没有匹配到任何规则时,流量默认由主出站协议发出",
"items": {
"type": "object",
"description": "",
"properties": {
"type": {
"type": "string",
"default": "field",
"description": "目前只支持\"field\"这一个选项",
"enum": ["field"]
},
"domain": {
"type": "array",
"description": "一个数组,数组每一项是一个域名的匹配,详情 https://www.v2ray.com/chapter_02/03_routing.html#ruleobject",
"items": {
"type": "string"
}
},
"ip": {
"type": "array",
"description": "一个数组,数组内每一个元素代表一个 IP 范围。当某一元素匹配目标 IP 时,此规则生效",
"items": {
"type": "string"
}
},
"port": {
"description": "端口范围",
"oneOf": [
{
"type": "number",
"description": " 为正整数,且小于 65536。当目标端口为 a 时,此规则生效"
},
{
"type": "string",
"description": "\"a-b\": a 和 b 均为正整数,且小于 65536。这个范围是一个前后闭合区间,当目标端口落在此范围内时,此规则生效"
}
]
},
"network": {
"type": "string",
"description": "可选的值有\"tcp\"、\"udp\"或\"tcp,udp\",当连接方式是指定的方式时,此规则生效",
"enum": ["tcp", "udp", "tcp,udp"]
},
"source": {
"type": "array",
"description": "一个数组,数组内每一个元素是一个 IP 或 CIDR。当某一元素匹配来源 IP 时,此规则生效",
"items": {
"type": "string"
}
},
"user": {
"type": "array",
"description": "一个数组,数组内每一个元素是一个邮箱地址。当某一元素匹配来源用户时,此规则生效。当前 Shadowsocks 和 VMess 支持此规则",
"items": {
"type": "string"
}
},
"inboundTag": {
"type": "string",
"description": "一个数组,数组内每一个元素是一个标识。当某一元素匹配入站协议的标识时,此规则生效",
"items": {
"type": "string"
}
},
"protocol": {
"type": "array",
"description": "一个数组,数组内每一个元素表示一种协议。当某一个协议匹配当前连接的流量时,此规则生效。必须开启入站代理中的sniffing选项",
"items": {
"type": "string",
"enum": ["http", "tls", "bittorrent"]
}
},
"attrs": {
"type": "string",
"description": "(V2Ray 4.18+) 一段脚本,用于检测流量的属性值。当此脚本返回真值时,此规则生效"
},
"outboundTag": {
"type": "string",
"description": "对应一个额外出站连接配置的标识"
},
"balancerTag": {
"type": "string",
"description": "对应一个负载均衡器的标识。balancerTag和outboundTag须二选一。当同时指定时,outboundTag生效"
}
}
}
},
"balancers": {
"type": "array",
"description": "(V2Ray 4.4+)一个数组,数组中每个元素是一个负载均衡器的配置。当一个规则指向一个负载均衡器时,V2Ray 会通过此负载均衡器选出一个出站协议,然后由它转发流量",
"items": {
"type": "object",
"description": "负载均衡器配置。当一个负载均衡器生效时,它会从指定的出站协议中,按配置选出一个最合适的出站协议,进行流量转发",
"properties": {
"tag": {
"type": "string",
"description": "此负载均衡器的标识,用于匹配RuleObject中的balancerTag"
},
"selector": {
"type": "array",
"description": "一个字符串数组,其中每一个字符串将用于和出站协议标识的前缀匹配",
"items": {
"type": "string",
"description": ""
}
}
}
}
}
}
},
"policy": {
"type": "object",
"description": "本地策略可进行一些权限相关的配置",
"properties": {
"levels": {
"type": "object",
"description": "一组键值对,每个键是一个字符串形式的数字(JSON 的要求),比如 \"0\"、\"1\" 等,双引号不能省略,这个数字对应用户等级",
"patternProperties": {
"^[0-9]+$": {
// todo 待添加
"type": "object",
"description": ""
}
}
},
"system": {
"type": "object",
"description": "V2Ray 系统的策略"
}
}
},
// todo 待添加
"reverse": {
"type": "object",
"description": "反向代理配置"
},
"inbounds": {
"type": "array",
"description": "一个数组,每个元素是一个入站连接配置",
"items": {
"type": "object",
"description": "入站连接用于接收从客户端(浏览器或上一级代理服务器)发来的数据",
"properties": {
"port": {
"type": "number",
"description": "端口"
},
"listen": {
"type": "string",
"description": "监听地址,只允许 IP 地址,默认值为\"0.0.0.0\",表示接收所有网卡上的连接。除此之外,必须指定一个现有网卡的地址"
},
"protocol": {
"$ref": "#/definitions/protocol"
},
"settings": {
"type": "object",
"description": "具体的配置内容,视协议不同而不同",
"oneOf": [
{
"type": "object",
"description": "Dokodemo door(任意门)是一个入站数据协议,它可以监听一个本地端口,并把所有进入此端口的数据发送至指定服务器的一个端口,从而达到端口映射的效果",
"properties": {
"type": {
"type": "string",
"enum": ["Dokodemo"]
},
"address": {
"type": "string",
"description": "将流量转发到此地址。可以是一个 IP 地址,形如\"1.2.3.4\",或者一个域名,形如\"v2ray.com\"。字符串类型"
},
"port": {
"type": "number",
"description": "将流量转发到目标地址的指定端口,范围[1, 65535],数值类型。必填参数"
},
"network": {
"type": "string",
"description": "可接收的网络协议类型。比如当指定为\"tcp\"时,任意门仅会接收 TCP 流量。默认值为\"tcp\"",
"enum": ["tcp", "udp", "tcp,udp"]
},
"timeout": {
"type": "number",
"description": "入站数据的时间限制(秒),默认值为 300"
},
"followRedirect": {
"type": "boolean",
"description": "当值为true时,dokodemo-door 会识别出由 iptables 转发而来的数据,并转发到相应的目标地址。详见传输配置中的tproxy设置"
},
"userLevel": {
"type": "number",
"description": "用户等级,所有连接都会使用这个用户等级"
}
}
},
{
"type": "object",
"description": "HTTP 是一个入站数据协议,兼容 HTTP 1.x 代理",
"properties": {
"type": {
"type": "string",
"enum": ["HTTP"]
},
"timeout": {
"type": "number",
"description": "从客户端读取数据的超时设置(秒),0 表示不限时。默认值为 300。 V2Ray 3.1 后等价于对应用户等级的 connIdle 策略"
},
"accounts": {
"type": "array",
"description": "一个数组,数组中每个元素为一个用户帐号。默认值为空",
"items": {
"type": "object",
"description": "",
"properties": {
"user": {
"type": "string",
"description": "用户名,字符串类型。必填"
},
"pass": {
"type": "string",
"description": "密码,字符串类型。必填"
}
}
}
},
"allowTransparent": {
"type": "boolean",
"description": "当为true时,会转发所有 HTTP 请求,而非只是代理请求。若配置不当,开启此选项会导致死循环"
},
"userLevel": {
"type": "number",
"description": "用户等级,所有连接使用这一等级"
}
}
},
{
"type": "object",
"description": "MTProto 是一个 Telegram 专用的代理协议。在 V2Ray 中可使用一组入站出站代理来完成 Telegram 数据的代理任务",
"properties": {
"type": {
"type": "string",
"enum": ["MTProto"]
},
"users": {
"type": "array",
"description": "一个数组,其中每一个元素表示一个用户。目前只有第一个用户会生效",
"items": {
"type": "object",
"description": "",
"properties": {
"email": {
"type": "string",
"description": "用户邮箱,用于统计流量等辅助功能",
"format": "email"
},
"level": {
"type": "number",
"description": "用户等级"
},
"secret": {
"type": "string",
"description": "用户密钥。必须为 32 个字符,仅可包含0到9和a到f之间的字符"
}
}
}
}
}
},
{
"type": "object",
"description": "Shadowsocks 协议,包含入站和出站两部分,兼容大部分其它版本的实现",
"properties": {
"type": {
"type": "string",
"enum": ["Shadowsocks"]
},
"email": {
"type": "string",
"description": "邮件地址,可选,用于标识用户",
"format": "email"
},
"method": {
"type": "string",
"description": "必填。可选的值见加密方式列表",
"enum": [
"aes-256-cfb",
"aes-128-cfb",
"chacha20",
"chacha20-ietf",
"aes-256-gcm",
"aes128-gcm",
"chacha20-poly1305",
"chacha20-ietf-poly1305"
]
},
"password": {
"type": "string",
"description": "必填,任意字符串。Shadowsocks 协议不限制密码长度,但短密码会更可能被破解,建议使用 16 字符或更长的密码"
},
"level": {
"type": "number",
"description": "用户等级,默认值为 0"
},
"ota": {
"type": "boolean",
"description": "是否强制 OTA,如果不指定此项,则自动判断。强制开启 OTA 后,V2Ray 会拒绝未启用 OTA 的连接。反之亦然"
},
"network": {
"type": "string",
"description": "可接收的网络连接类型,默认值为\"tcp\"",
"enum": ["tcp", "udp", "tcp,udp"]
}
}
},
{
"type": "object",
"description": "标准 Socks 协议实现,兼容 Socks 4、Socks 4a 和 Socks 5",
"properties": {
"type": {
"type": "string",
"enum": ["Socks"]
},
"auth": {
"type": "string",
"description": "Socks 协议的认证方式,支持\"noauth\"匿名方式和\"password\"用户密码方式。默认值为\"noauth\"",
"enum": ["noauth", "password"]
},
"accounts": {
"type": "array",
"description": "一个数组,数组中每个元素为一个用户帐号。默认值为空。此选项仅当 auth 为 password 时有效",
"items": {
"$ref": "#/definitions/account"
}
},
"udp": {
"type": "boolean",
"description": "是否开启 UDP 协议的支持。默认值为 false"
},
"ip": {
"type": "string",
"description": "当开启 UDP 时,V2Ray 需要知道本机的 IP 地址。默认值为\"127.0.0.1\""
},
"userLevel": {
"type": "number",
"description": "用户等级,所有连接使用这一等级"
}
}
},
{
"type": "object",
"description": "VMess 是一个加密传输协议,它分为入站和出站两部分,通常作为 V2Ray 客户端和服务器之间的桥梁",
"properties": {
"type": {
"type": "string",
"enum": ["Vmess"]
},
"clients": {
"type": "array",
"description": "一组服务器认可的用户。clients 可以为空。当此配置用作动态端口时,V2Ray 会自动创建用户",
"items": {
"type": "object",
"description": "",
"properties": {
"id": {
"type": "string",
"description": "VMess 的用户 ID。必须是一个合法的 UUID"
},
"level": {
"type": "number",
"description": "用户等级"
},
"alterId": {
"type": "number",
"description": "为了进一步防止被探测,一个用户可以在主 ID 的基础上,再额外生成多个 ID。这里只需要指定额外的 ID 的数量,推荐值为 4。不指定的话,默认值是 0。最大值 65535。这个值不能超过服务器端所指定的值"
},
"email": {
"type": "string",
"description": "用户邮箱地址,用于区分不同用户的流量",
"format": "email"
}
}
}
},
"default": {
"type": "object",
"description": "指示对应的出站协议使用另一个服务器",
"properties": {
"level": {
"type": "number",
"description": "用户等级,默认值为0"
},
"alterId": {
"type": "number",
"description": "为了进一步防止被探测,一个用户可以在主 ID 的基础上,再额外生成多个 ID。这里只需要指定额外的 ID 的数量,推荐值为 4。不指定的话,默认值是 0。最大值 65535。这个值不能超过服务器端所指定的值"
}
}
},
"detour": {
"type": "object",
"description": "可选,clients 的默认配置。仅在配合detour时有效",
"properties": {
"to": {
"type": "string",
"description": "一个入站协议的tag,详见配置文件。指定的入站协议必须是一个 VMess"
}
}
},
"disableInsecureEncryption": {
"type": "boolean",
"description": "是否禁止客户端使用不安全的加密方式,当客户端指定下列加密方式时,服务器会主动断开连接。默认值为false"
}
}
}
]
},
"streamSettings": {
"description": "底层传输配置",
"$ref": "#/definitions/streamSettings"
},
"tag": {
"type": "string",
"description": "此入站连接的标识,用于在其它的配置中定位此连接。当其不为空时,其值必须在所有tag中唯一"
},
"sniffing": {
"type": "object",
"description": "尝试探测流量的类型",
"properties": {
"enabled": {
"type": "boolean",
"description": "是否开启流量探测"
},
"destOverride": {
"type": "array",
"description": "当流量为指定类型时,按其中包括的目标地址重置当前连接的目标",
"items": {
"type": "string",
"enum": ["http", "tls"]
}
}
}
},
"allocate": {
"type": "object",
"description": "端口分配设置",
"properties": {
"strategy": {
"type": "string",
"description": "端口分配策略。\"always\"表示总是分配所有已指定的端口,port中指定了多少个端口,V2Ray 就会监听这些端口。\"random\"表示随机开放端口,每隔refresh分钟在port范围中随机选取concurrency个端口来监听",
"enum": ["always", "random"]
},
"refresh": {
"type": "number",
"description": "随机端口刷新间隔,单位为分钟。最小值为2,建议值为5。这个属性仅当strategy = random时有效"
},
"concurrency": {
"type": "number",
"description": "随机端口数量。最小值为1,最大值为port范围的三分之一。建议值为3"
}
}
}
}
}
},
"outbounds": {
"type": "array",
"description": "一个数组,每个元素是一个出站连接配置。列表中的第一个元素作为主出站协议。当路由匹配不存在或没有匹配成功时,流量由主出站协议发出",
"items": {
"type": "object",
"properties": {
"sendThrough": {
"type": "string",
"description": "用于发送数据的 IP 地址,当主机有多个 IP 地址时有效,默认值为\"0.0.0.0\""
},
"protocol": {
"$ref": "#/definitions/protocol"
},
"settings": {
"type": "object",
"description": "具体的配置内容,视协议不同而不同",
"oneOf": [
{
"type": "object",
"description": "Blackhole(黑洞)是一个出站数据协议,它会阻碍所有数据的出站,配合路由(Routing)一起使用,可以达到禁止访问某些网站的效果",
"properties": {
"type": {
"type": "string",
"enum": ["Blackhole"]
},
"response": {
"type": "object",
"description": "配置黑洞的响应数据。Blackhole 会在收到待转发数据之后,发送指定的响应数据,然后关闭连接。待转发的数据将被丢弃。如不指定此项,Blackhole 将直接关闭连接",
"properties": {
"type": {
"type": "string",
"description": "type为\"none\"(默认值)时,Blackhole将直接关闭连接。当type为\"http\"时,Blackhole会发回一个简单的 HTTP 403 数据包,然后关闭连接",
"enum": ["http", "none"]
}
}
}
}
},
{
"type": "object",
"description": "DNS 是一个出站协议,主要用于拦截和转发 DNS 查询。此出站协议只能接收 DNS 流量(包含基于 UDP 和 TCP 协议的查询),其它类型的流量会导致错误",
"properties": {
"type": {
"type": "string",
"enum": ["DNS"]
},
"network": {
"type": "string",
"description": "(V2Ray 4.16+) 修改 DNS 流量的传输层协议,可选的值有\"tcp\"和\"udp\"。当不指定时,保持来源的传输方式不变",
"enum": ["tcp", "udp"]
},
"address": {
"type": "string",
"description": "(V2Ray 4.16+) 修改 DNS 服务器地址。当不指定时,保持来源中指定的地址不变"
},
"port": {
"type": "number",
"description": "(V2Ray 4.16+) 修改 DNS 服务器端口。当不指定时,保持来源中指定的端口不变"
}
}
},
{
"type": "object",
"description": "Freedom 是一个出站协议,可以用来向任意网络发送(正常的) TCP 或 UDP 数据",
"properties": {
"type": {
"type": "string",
"enum": ["Freedom"]
},
"domainStrategy": {
"type": "string",
"description": "在目标地址为域名时,Freedom 可以直接向此域名发出连接(\"AsIs\"),或者将域名解析为 IP 之后再建立连接(\"UseIP\"、\"UseIPv4\"、\"UseIPv6\")。解析 IP 的步骤会使用 V2Ray 内建的 DNS。默认值为\"AsIs\"\n(V2Ray 4.6+) 当使用\"UseIP\"模式,并且出站连接配置中指定了sendThrough时,Freedom 会根据sendThrough的值自动判断所需的IP类型,IPv4 或 IPv6\n(V2Ray 4.7+) 当使用\"UseIPv4\"或\"UseIPv6\"模式时,Freedom 会只使用对应的 IPv4 或 IPv6 地址。当sendThrough指定了不匹配的本地地址时,将导致连接失败",
"enum": ["AsIs", "UseIP", "UseIPv4", "UseIPv6"]
},
"redirect": {
"type": "string",
"description": "Freedom 会强制将所有数据发送到指定地址(而不是入站协议指定的地址)。其值为一个字符串,样例:\"127.0.0.1:80\", \":1234\"。当地址不指定时,如\":443\",Freedom 不会修改原先的目标地址。当端口为0时,如\"v2ray.com:0\",Freedom 不会修改原先的端口"
},
"userLevel": {
"type": "string",
"description": "用户等级,所有连接都使用这一等级"
}
}
},
{
"type": "object",
"description": "MTProto 是一个 Telegram 专用的代理协议。在 V2Ray 中可使用一组入站出站代理来完成 Telegram 数据的代理任务。目前只支持转发到 Telegram 的 IPv4 地址",
"properties": {
"type": {
"type": "string",
"enum": ["MTProto"]
}
}
},
{
"type": "object",
"description": "Shadowsocks 协议,包含入站和出站两部分,兼容大部分其它版本的实现",
"properties": {
"type": {
"type": "string",
"enum": ["Shadowsocks"]
},
"servers": {
"type": "array",
"description": "一个数组,其中每一项是一个 ServerObject",
"items": {
"type": "object",
"description": "",
"required": ["address", "port", "method", "password"],
"properties": {
"email": {
"type": "string",
"description": "邮件地址,可选,用于标识用户",
"format": "email"
},
"address": {
"type": "string",
"description": "Shadowsocks 服务器地址,支持 IPv4、IPv6 和域名。必填"
},
"port": {
"type": "string",
"description": "Shadowsocks 服务器端口。必填"
},
"method": {
"type": "string",
"description": "必填。可选的值见加密方式列表",
"enum": [
"aes-256-cfb",
"aes-128-cfb",
"chacha20",
"chacha20-ietf",
"aes-256-gcm",
"aes128-gcm",
"chacha20-poly1305",
"chacha20-ietf-poly1305"
]
},
"password": {
"type": "string",
"description": "必填。任意字符串。Shadowsocks 协议不限制密码长度,但短密码会更可能被破解,建议使用 16 字符或更长的密码"
},
"ota": {
"type": "boolean",
"description": "是否开启 Shadowsocks 的一次验证(One time auth),默认值为false"
},
"level": {
"type": "number",
"description": "用户等级"
}
}
}
}
}
},
{
"type": "object",
"description": "标准 Socks 协议实现,兼容 Socks 4、Socks 4a 和 Socks 5",
"properties": {
"type": {
"type": "string",
"enum": ["Socks"]
},
"servers": {
"type": "array",
"description": "Socks 服务器列表,其中每一项是一个服务器配置",
"items": {
"type": "object",
"description": "",
"properties": {
"address": {
"type": "string",
"description": "服务器地址,仅支持连接到 Socks 5 服务器"
},
"port": {
"type": "number",
"description": "服务器端口"
},
"users": {
"type": "array",
"description": "用户列表,其中每一项一个用户配置。当列表不为空时,Socks 客户端会使用此用户信息进行认证;如未指定,则不进行认证",
"items": {
"type": "object",
"description": "",
"allOf": [
{
"$ref": "#/definitions/account"
},
{
"properties": {
"level": {
"type": "number",
"description": "用户等级"
}
}
}
]
}
}
}
}
}
}
},
{
"type": "object",
"description": "VMess 是一个加密传输协议,它分为入站和出站两部分,通常作为 V2Ray 客户端和服务器之间的桥梁\nVMess 依赖于系统时间,请确保使用 V2Ray 的系统 UTC 时间误差在 90 秒之内,时区无关。在 Linux 系统中可以安装ntp服务来自动同步系统时间",
"properties": {
"type": {
"type": "string",
"enum": ["VMess"]
},
"vnext": {
"type": "array",
"description": "一个数组,包含一系列的服务器配置",
"items": {
"type": "object",
"description": "",
"properties": {
"address": {
"type": "string",
"description": "服务器地址,支持 IP 地址或者域名"
},
"port": {
"type": "number",
"description": "服务器端口号"
},
"users": {
"type": "array",
"description": "一组服务器认可的用户",
"items": {
"type": "object",
"description": "",
"properties": {
"id": {
"type": "string",
"description": "VMess 用户的主 ID。必须是一个合法的 UUID"
},
"alterId": {
"type": "number",
"default": 4,
"description": "为了进一步防止被探测,一个用户可以在主 ID 的基础上,再额外生成多个 ID。这里只需要指定额外的 ID 的数量,推荐值为 4。不指定的话,默认值是 0。最大值 65535。这个值不能超过服务器端所指定的值"
},
"security": {
"type": "string",
"default": "auto",
"description": "加密方式,客户端将使用配置的加密方式发送数据,服务器端自动识别,无需配置",
"enum": ["aes-128-gcm", "chacha20-poly1305", "auto", "none"]
},
"level": {
"type": "number",
"description": "用户等级"
}
}
}
}
}
}
}
}
}
]
},
"tag": {
"type": "string",
"description": "此出站连接的标识,用于在其它的配置中定位此连接。当其值不为空时,必须在所有 tag 中唯一"
},
"streamSettings": {
"description": "底层传输配置",
"$ref": "#/definitions/streamSettings"
},
"proxySettings": {
"type": "object",
"description": "出站代理配置。当出站代理生效时,此出站协议的streamSettings将不起作用",
"properties": {
"tag": {
"type": "string",
"description": "当指定另一个出站协议的标识时,此出站协议发出的数据,将被转发至所指定的出站协议发出"
}
}
},
"mux": {
"type": "object",
"description": "Mux 配置,Mux 功能是在一条 TCP 连接上分发多个 TCP 连接的数据",
"properties": {
"enabled": {
"type": "boolean",
"description": "是否启用 Mux"
},
"concurrency": {
"type": "number",
"description": "最大并发连接数。最小值1,最大值1024,默认值8。这个数值表示了一个 TCP 连接上最多承载的 Mux 连接数量。当客户端发出了 8 个 TCP 请求,而concurrency=8时,V2Ray 只会发出一条实际的 TCP 连接,客户端的 8 个请求全部由这个 TCP 连接传输"
}
}
}
}
}
},
"transport": {
"type": "object",
"description": "用于配置 V2Ray 如何与其它服务器建立和使用网络连接",
"$ref": "#/definitions/transportSetting"
}
}
}
@0x-jerry
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment