Closed gsh20040816 closed 1 year ago
我从不用链式。建议一下,你就开vless tcp tls到你VPS上,VPS上写路由规则加出站(比如你开的SS2022)规则,再到你落地的VPS得了。
何必客户端写这么多了。
我从不用链式。建议一下,你就开vless tcp tls到你VPS上,VPS上写路由规则加出站(比如你开的SS2022)规则,再到你落地的VPS得了。
何必客户端写这么多了。
我是用机场中转的... vps 基本上直连已经没法用了,所以我才用链式
我从不用链式。建议一下,你就开vless tcp tls到你VPS上,VPS上写路由规则加出站(比如你开的SS2022)规则,再到你落地的VPS得了。 何必客户端写这么多了。
我是用机场中转的... vps 基本上直连已经没法用了,所以我才用链式
那帮不了你了。建议你买好点的VPS,交点学费花时间学点买VPS如何挑机知识,自建吧,不用机场
最近正在用v2rayNG玩类似配置,也是用机场进行链式中转, 踩过一样的坑
我帮你稍微修改了下配置 问题原因: outbounds有多个节点的时候,libv2ray只会帮第一个节点进行域名预解析成ip 预解析域名的时候logcat日志会看到 I GoLog : Using Prepared: xx.xx.xx.xx 看到你的日志中有: I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 domain1.com没有被预解析成ip, dns查询会去proxy节点, proxy节点依赖于chain, chain节点的address是域名->死循环 这样会导致dns无法正常工作
解决方法: 方法一: 把客户端出去的第一跳节点的域名手动修改成ip 方法二: 把第一跳节点故意放到outbounds数组第一个元素, 后续的第二跳,第三跳节点域名不用管, 应该中转机器有能力解析 注意我最后添加的路由规则,如果不加, 默认会从outbounds第一个节点直接出去,达不到链式代理的效果!
其实更好的解决方案是从libv2ray里面入手, 把所有outbounds里面的域名都进行预解析, 这个我不会搞,需要修改到库里面的代码
你自己测测吧,反正我这么改就好了
{
"dns": {
"hosts": {
"domain:googleapis.cn": "googleapis.com"
},
"servers": [
{
"address": "223.5.5.5",
"domains": [
"domain1.com"
],
"port": 53
},
"1.1.1.1",
{
"address": "223.5.5.5",
"domains": [
"geosite:cn"
],
"expectIPs": [
"geoip:cn"
],
"port": 53
}
]
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true,
"userLevel": 8
},
"sniffing": {
"destOverride": [
],
"enabled": false
},
"tag": "socks"
},
{
"listen": "127.0.0.1",
"port": 10809,
"protocol": "http",
"settings": {
"userLevel": 8
},
"tag": "http"
}
],
"log": {
"loglevel": "warning"
},
"outbounds": [
{
"mux": {
"concurrency": 8,
"enabled": false
},
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "domain1.com",
"level": 8,
"method": "chacha20-ietf-poly1305",
"ota": false,
"password": "password",
"port": 11451
}
]
},
"streamSettings": {
"network": "tcp",
"security": ""
},
"tag": "chain"
},
{
"mux": {
"concurrency": 8,
"enabled": false
},
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "11.4.51.4",
"port": 443,
"users": [
{
"encryption": "none",
"flow": "",
"id": "uuid",
"level": 8,
"security": "auto"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tcpSettings": {
"header": {
"type": "none"
}
},
"tlsSettings": {
"allowInsecure": false,
"serverName": "domain2.com"
}
},
"proxySettings": {
"tag": "chain"
},
"tag": "proxy"
},
{
"protocol": "freedom",
"settings": {
},
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
},
"tag": "block"
}
],
"routing": {
"domainMatcher": "mph",
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"ip": [
"1.1.1.1"
],
"outboundTag": "proxy",
"port": "53",
"type": "field"
},
{
"ip": [
"223.5.5.5"
],
"outboundTag": "direct",
"port": "53",
"type": "field"
},
{
"domain": [
"domain:googleapis.cn"
],
"outboundTag": "proxy",
"type": "field"
},
{
"domain": [
"domain:domain1.com"
],
"outboundTag": "direct",
"type": "field"
},
{
"ip": [
"geoip:private"
],
"outboundTag": "direct",
"type": "field"
},
{
"ip": [
"geoip:cn"
],
"outboundTag": "direct",
"type": "field"
},
{
"domain": [
"geosite:cn"
],
"outboundTag": "direct",
"type": "field"
},
{
"inboundTag": [
"socks",
"http"
],
"outboundTag": "proxy",
"type": "field"
}
]
}
}
最近正在用v2rayNG玩类似配置,也是用机场进行链式中转, 踩过一样的坑
我帮你稍微修改了下配置 问题原因: outbounds有多个节点的时候,libv2ray只会帮第一个节点进行域名预解析成ip 预解析域名的时候logcat日志会看到 I GoLog : Using Prepared: xx.xx.xx.xx 看到你的日志中有: I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 domain1.com没有被预解析成ip, dns查询会去proxy节点, proxy节点依赖于chain, chain节点的address是域名->死循环 这样会导致dns无法正常工作
解决方法: 方法一: 把客户端出去的第一跳节点的域名手动修改成ip 方法二: 把第一跳节点故意放到outbounds数组第一个元素, 后续的第二跳,第三跳节点域名不用管, 应该中转机器有能力解析 注意我最后添加的路由规则,如果不加, 默认会从outbounds第一个节点直接出去,达不到链式代理的效果!
其实更好的解决方案是从libv2ray里面入手, 把所有outbounds里面的域名都进行预解析, 这个我不会搞,需要修改到库里面的代码
你自己测测吧,反正我这么改就好了
{ "dns": { "hosts": { "domain:googleapis.cn": "googleapis.com" }, "servers": [ { "address": "223.5.5.5", "domains": [ "domain1.com" ], "port": 53 }, "1.1.1.1", { "address": "223.5.5.5", "domains": [ "geosite:cn" ], "expectIPs": [ "geoip:cn" ], "port": 53 } ] }, "inbounds": [ { "listen": "127.0.0.1", "port": 10808, "protocol": "socks", "settings": { "auth": "noauth", "udp": true, "userLevel": 8 }, "sniffing": { "destOverride": [ ], "enabled": false }, "tag": "socks" }, { "listen": "127.0.0.1", "port": 10809, "protocol": "http", "settings": { "userLevel": 8 }, "tag": "http" } ], "log": { "loglevel": "warning" }, "outbounds": [ { "mux": { "concurrency": 8, "enabled": false }, "protocol": "shadowsocks", "settings": { "servers": [ { "address": "domain1.com", "level": 8, "method": "chacha20-ietf-poly1305", "ota": false, "password": "password", "port": 11451 } ] }, "streamSettings": { "network": "tcp", "security": "" }, "tag": "chain" }, { "mux": { "concurrency": 8, "enabled": false }, "protocol": "vless", "settings": { "vnext": [ { "address": "11.4.51.4", "port": 443, "users": [ { "encryption": "none", "flow": "", "id": "uuid", "level": 8, "security": "auto" } ] } ] }, "streamSettings": { "network": "tcp", "security": "tls", "tcpSettings": { "header": { "type": "none" } }, "tlsSettings": { "allowInsecure": false, "serverName": "domain2.com" } }, "proxySettings": { "tag": "chain" }, "tag": "proxy" }, { "protocol": "freedom", "settings": { }, "tag": "direct" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "block" } ], "routing": { "domainMatcher": "mph", "domainStrategy": "IPIfNonMatch", "rules": [ { "ip": [ "1.1.1.1" ], "outboundTag": "proxy", "port": "53", "type": "field" }, { "ip": [ "223.5.5.5" ], "outboundTag": "direct", "port": "53", "type": "field" }, { "domain": [ "domain:googleapis.cn" ], "outboundTag": "proxy", "type": "field" }, { "domain": [ "domain:domain1.com" ], "outboundTag": "direct", "type": "field" }, { "ip": [ "geoip:private" ], "outboundTag": "direct", "type": "field" }, { "ip": [ "geoip:cn" ], "outboundTag": "direct", "type": "field" }, { "domain": [ "geosite:cn" ], "outboundTag": "direct", "type": "field" }, { "inboundTag": [ "socks", "http" ], "outboundTag": "proxy", "type": "field" } ] } }
谢谢,不过我已经转到 SagerNet 了。
在提出问题前请先自行排除服务器端问题,同时也请通过搜索确认是否有人提出过相同问题。
预期行为
链式代理可以正常工作
实际行为
vpn 模式下链式代理无法连接,仅代理模式链式代理可用。此配置在 Linux 桌面经过测试。
复现方法
配置:
日志信息
环境信息
android12 v2rayNG 1.7.17
额外信息(可选)