You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
目前多文件配置对 Object 的处理都是整个覆盖的,这样处理很不灵活,是否可以引入”补充“模式。
补充模式建议
默认是之前的模式,整个 Object 覆盖,当字段名添加
:expand后缀时表示是补充模式(或许可以讨论一下更好的处理方式,总之希望有类似功能),比如下面例子:{ "log": { "access": "none", "error": "/var/log/xray/error.log" }, "api": { "tag": "api", "listen": "127.0.0.1:8080", "services": [ "HandlerService", "LoggerService", "StatsService", "RoutingService" ] }, "inbounds": [ { "tag": "socks", "protocol": "socks", "listen": "127.0.0.1", "settings": { "auth": "noauth", "users": [ { "user": "my-username", "pass": "my-password" } ], "udp": false, "ip": "127.0.0.1", "userLevel": 0 }, "port": 8888, "sniffing": { "enabled": true, "destOverride": ["tls"] } } ] }{ // 补充模式 "log:expand": { "access": "/var/log/xray/access.log", "dnsLog": true, "maskAddress": "quarter" }, // 默认模式 "api": { "tag": "api", "services": ["HandlerService", "RoutingService"] }, "inbounds": [ { // inbound tag 补充模式 "tag:expand": "socks", "listen": "0.0.0.0", // 嵌套补充模式 "settings:expand": { "ip": "0.0.0.0" } } ] }{ "log": { // 补充模式,修改已存在字段 "access": "/var/log/xray/access.log", // 补充模式,保留原有字段 "error": "/var/log/xray/error.log", // 补充模式,添加新的字段 "dnsLog": true, "maskAddress": "quarter" }, "api": { // 默认模式,整个 Object 进行覆盖 "tag": "api", "services": ["HandlerService", "RoutingService"] }, "inbounds": [ { "tag": "socks", "protocol": "socks", // 补充模式,修改已存在字段 "listen": "0.0.0.0", "settings": { "auth": "noauth", "users": [ { "user": "my-username", "pass": "my-password" } ], "udp": false, // 补充模式,修改已存在字段 "ip": "0.0.0.0", "userLevel": 0 }, "port": 8888, "sniffing": { "enabled": true, "destOverride": ["tls"] } } ] }All reactions