-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Optimize proxy chain handling for multiple nodes #7468
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
Merged
Merged
Conversation
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
xray outbound 输出示例:[
{
"tag": "proxy-1",
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "456",
"method": "aes-128-gcm",
"ota": false,
"password": "456",
"port": 456,
"level": 1
}
]
},
"streamSettings": {
"network": "tcp",
"sockopt": {
"dialerProxy": "mid-proxy-1"
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "mid-proxy-1",
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "0.0.0.0",
"port": 443,
"users": [
{
"id": "67b9b87f-c688-437d-a517-03e209fcb294",
"email": "[email protected]",
"security": "auto",
"encryption": "none",
"flow": "xtls-rprx-vision"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"allowInsecure": false,
"serverName": "***",
"fingerprint": "chrome"
},
"sockopt": {
"dialerProxy": "proxy-prev-1"
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "proxy-2",
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "456",
"method": "aes-128-gcm",
"ota": false,
"password": "456",
"port": 456,
"level": 1
}
]
},
"streamSettings": {
"network": "tcp",
"sockopt": {
"dialerProxy": "mid-proxy-2"
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "mid-proxy-2",
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "0.0.0.0",
"port": 443,
"users": [
{
"id": "67b9b87f-c688-437d-a517-03e209fcb294",
"email": "[email protected]",
"security": "auto",
"encryption": "none",
"flow": "xtls-rprx-vision"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"allowInsecure": false,
"serverName": "***",
"fingerprint": "chrome"
},
"sockopt": {
"dialerProxy": "proxy-prev-1"
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "proxy-3",
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "456",
"method": "aes-128-gcm",
"ota": false,
"password": "456",
"port": 456,
"level": 1
}
]
},
"streamSettings": {
"network": "tcp",
"sockopt": {
"dialerProxy": "mid-proxy-3"
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "mid-proxy-3",
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "0.0.0.0",
"port": 443,
"users": [
{
"id": "67b9b87f-c688-437d-a517-03e209fcb294",
"email": "[email protected]",
"security": "auto",
"encryption": "none",
"flow": "xtls-rprx-vision"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"allowInsecure": false,
"serverName": "***",
"fingerprint": "safari"
},
"sockopt": {
"dialerProxy": "proxy-prev-1"
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "proxy-prev-1",
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "123",
"method": "aes-128-gcm",
"ota": false,
"password": "123",
"port": 123,
"level": 1
}
]
},
"streamSettings": {
"network": "tcp"
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "direct",
"protocol": "freedom"
},
{
"tag": "block",
"protocol": "blackhole"
}
] sing-box outbound 输出示例:[
{
"type": "selector",
"tag": "proxy",
"outbounds": [
"proxy-auto",
"proxy-1",
"proxy-2",
"proxy-3"
],
"interrupt_exist_connections": false
},
{
"type": "urltest",
"tag": "proxy-auto",
"outbounds": [
"proxy-1",
"proxy-2",
"proxy-3"
],
"interrupt_exist_connections": false
},
{
"type": "shadowsocks",
"tag": "proxy-1",
"server": "456",
"server_port": 456,
"detour": "mid-proxy-1",
"method": "aes-128-gcm",
"password": "456"
},
{
"type": "vless",
"tag": "mid-proxy-1",
"server": "0.0.0.0",
"server_port": 443,
"uuid": "67b9b87f-c688-437d-a517-03e209fcb294",
"flow": "xtls-rprx-vision",
"detour": "proxy-prev-1",
"packet_encoding": "xudp",
"tls": {
"enabled": true,
"server_name": "***",
"insecure": false,
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
}
},
{
"type": "shadowsocks",
"tag": "proxy-2",
"server": "456",
"server_port": 456,
"detour": "mid-proxy-2",
"method": "aes-128-gcm",
"password": "456"
},
{
"type": "vless",
"tag": "mid-proxy-2",
"server": "0.0.0.0",
"server_port": 443,
"uuid": "67b9b87f-c688-437d-a517-03e209fcb294",
"flow": "xtls-rprx-vision",
"detour": "proxy-prev-1",
"packet_encoding": "xudp",
"tls": {
"enabled": true,
"server_name": "***",
"insecure": false,
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
}
},
{
"type": "shadowsocks",
"tag": "proxy-3",
"server": "456",
"server_port": 456,
"detour": "mid-proxy-3",
"method": "aes-128-gcm",
"password": "456"
},
{
"type": "vless",
"tag": "mid-proxy-3",
"server": "0.0.0.0",
"server_port": 443,
"uuid": "67b9b87f-c688-437d-a517-03e209fcb294",
"flow": "xtls-rprx-vision",
"detour": "proxy-prev-1",
"packet_encoding": "xudp",
"tls": {
"enabled": true,
"server_name": "***",
"insecure": false,
"utls": {
"enabled": true,
"fingerprint": "safari"
}
}
},
{
"type": "shadowsocks",
"tag": "proxy-prev-1",
"server": "123",
"server_port": 123,
"method": "aes-128-gcm",
"password": "123"
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns_out"
}
] |
是好功能,但是产生配置文件变得更复杂了。。。 |
确实,ai 优化后代码量多了一倍,不过整体代码可读性比我写的好 后面我试试优化代码,添加个辅助函数或与 GenMoreOutbounds 联动 |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
添加 多配置文件-链式代理 支持
当多个配置文件使用同一个前置节点时,生成一个前置节点 outbound,多个配置文件的 sockopt 指向前置节点 outbound.tag
GenOutboundsList 负责 GenOutbound 和 GenMoreOutbounds 的功能