-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于输出 json 结构的顺序问题 #38
Comments
现在应该是保持了模板的顺序 |
我这没变化,还是乱的 input
output
|
Go 的 map 就是乱序的,所以不太好保持模板的顺序。但是规则之类的是有顺序的。 |
由于go默认排序这个原因,导致默认出站可能是无效的服务器
"outbounds": [
{
"tag": "select",
"type": "selector",
"default": "urltest",
"outbounds": [
"urltest",
"HongKong"
]
},
{
"tag": "HongKong",
"type": "urltest",
"outbounds": ["include: 🇭🇰|HK|hk|香港|港|HongKong"]
},
{
"tag": "urltest",
"type": "urltest",
"outbounds": ["exclude: 需要包含所有"]
}
],
"outbounds": [
{
"password": "1234",
"server": "test.com",
"server_port": 1234,
"tag": "无效节点香港",
"type": "shadowsocks",
"method": "aes-256-gcm"
},
{
"password": "1234",
"server": "test.com",
"server_port": 1234,
"tag": "有效节点香港",
"type": "shadowsocks",
"method": "aes-256-gcm"
},
{
"tag": "direct",
"type": "direct"
},
{
"tag": "block",
"type": "block"
},
{
"tag": "dns-out",
"type": "dns"
},
{
"default": "urltest",
"outbounds": [
"urltest",
"HongKong"
],
"tag": "select",
"type": "selector"
},
{
"outbounds": [
"无效节点香港",
"有效节点香港"
],
"tag": "HongKong",
"type": "urltest"
},
{
"outbounds": [
"无效节点香港",
"有效节点香港"
],
"tag": "urltest",
"type": "urltest"
}
] 在经由前面的模板转换后,所有的节点排序排在了节点集合之前,导致第一个节点成为了默认节点,后续的出站路由表匹配完所有规则后没有命中就会走
|
outbounds 一直都是有序的,只是规则不太一样。 现在在禁用默认生成的 urltest 和 selector后,模板中添加的节点会在第一位。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
能否保持输入模版的结构顺序
The text was updated successfully, but these errors were encountered: