2dust / v2rayNG

A V2Ray client for Android, support Xray core and v2fly core
https://1.2345345.xyz
GNU General Public License v3.0
36.06k stars 5.51k forks source link

链式代理(自定义配置)无法连接 #1615

Closed gsh20040816 closed 1 year ago

gsh20040816 commented 2 years ago

在提出问题前请先自行排除服务器端问题,同时也请通过搜索确认是否有人提出过相同问题。

预期行为

链式代理可以正常工作

实际行为

vpn 模式下链式代理无法连接,仅代理模式链式代理可用。此配置在 Linux 桌面经过测试。

复现方法

配置:

```json { "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": "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" }, { "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" }, { "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" } ] } } ```

日志信息

通过`adb logcat -s com.v2ray.ang GoLog V2rayConfigUtilGoLog Main`获取日志。请自行删减日志中可能出现的敏感信息。 如果问题可重现,建议先执行`adb logcat -c`清空系统日志再执行上述命令,再操作重现问题。 ``` 08-10 23:04:41.425 I/GoLog (15871): loading core config 08-10 23:04:41.425 I/GoLog (15871): Preparing Domain: 11.4.51.4:443 08-10 23:04:41.425 I/GoLog (15871): Prepare Result: 08-10 23:04:41.425 I/GoLog (15871): Domain: 11.4.51.4 08-10 23:04:41.425 I/GoLog (15871): Port: 443 08-10 23:04:41.425 I/GoLog (15871): IPs: [11.4.51.4] 08-10 23:04:42.027 I/GoLog (15871): new core 08-10 23:04:42.027 I/GoLog (15871): [Debug] app/log: Logger started 08-10 23:04:42.058 I/GoLog (15871): [Info] app/dns: DNS: created UDP client initialized for 223.5.5.5:53 08-10 23:04:42.058 I/GoLog (15871): [Info] app/dns: DNS: created UDP client initialized for 1.1.1.1:53 08-10 23:04:42.058 I/GoLog (15871): [Info] app/dns: DNS: created UDP client initialized for 223.5.5.5:53 08-10 23:04:42.107 I/GoLog (15871): [Debug] app/router: MphDomainMatcher is enabled for 1 domain rule(s) 08-10 23:04:42.107 I/GoLog (15871): [Debug] app/router: MphDomainMatcher is enabled for 1 domain rule(s) 08-10 23:04:42.227 I/GoLog (15871): start core 08-10 23:04:42.227 I/GoLog (15871): [Debug] app/router: MphDomainMatcher is enabled for 66423 domain rule(s) 08-10 23:04:42.229 I/GoLog (15871): [Debug] app/proxyman/inbound: creating stream worker on 127.0.0.1:10808 08-10 23:04:42.229 I/GoLog (15871): [Debug] app/proxyman/inbound: creating stream worker on 127.0.0.1:10809 08-10 23:04:42.229 I/GoLog (15871): [Info] transport/internet/tcp: listening TCP on 127.0.0.1:10808 08-10 23:04:42.229 I/GoLog (15871): [Info] transport/internet/udp: listening UDP on 127.0.0.1:10808 08-10 23:04:42.229 I/GoLog (15871): [Info] transport/internet/tcp: listening TCP on 127.0.0.1:10809 08-10 23:04:42.229 I/GoLog (15871): [Warning] core: Xray 1.5.9 started 08-10 23:04:42.260 D/com.v2ray.ang(15871): [/data/app/~~fgTLi5hrhFMGJ8sYb3_UVQ==/com.v2ray.ang-QKg5K5gcOB0aYTikQRiW-A==/lib/arm64/libtun2socks.so, --netif-ipaddr, 26.26.26.2, --netif-netmask, 255.255.255.252, --socks-server-addr, 127.0.0.1:10808, --tunmtu, 1500, --sock-path, sock_path, --enable-udprelay, --loglevel, notice] 08-10 23:04:42.263 D/com.v2ray.ang(15871): Process[pid=27030, hasExited=false] 08-10 23:04:42.263 D/com.v2ray.ang(15871): /data/user/0/com.v2ray.ang/files/sock_path 08-10 23:04:42.271 I/tun2socks(27030): NOTICE(tun2socks): initializing BadVPN tun2socks 1.999.130 08-10 23:04:42.314 D/com.v2ray.ang(15871): sendFd tries: 0 08-10 23:04:42.315 I/tun2socks(27030): NOTICE(tun2socks): entering event loop 08-10 23:04:42.350 I/GoLog (15871): [Info] [1638122170] proxy/socks: TCP Connect request to tcp:54.223.208.21:5229 08-10 23:04:42.350 I/GoLog (15871): [Info] [1638122170] app/dispatcher: taking detour [direct] for [tcp:54.223.208.21:5229] 08-10 23:04:42.350 I/GoLog (15871): [Info] [1638122170] proxy/freedom: opening connection to tcp:54.223.208.21:5229 08-10 23:04:42.350 I/GoLog (15871): [Info] [1638122170] transport/internet/tcp: dialing TCP to tcp:54.223.208.21:5229 08-10 23:04:42.350 I/GoLog (15871): tcp:127.0.0.1:60004 accepted tcp:54.223.208.21:5229 [socks -> direct] 08-10 23:04:42.350 I/GoLog (15871): Not Using Prepared: tcp,54.223.208.21:5229 08-10 23:04:42.443 I/GoLog (15871): Not Using Prepared: tcp,connectivity.samsung.com.cn:443 08-10 23:04:42.443 I/GoLog (15871): [Info] [2276954216] proxy/http: request to Method [CONNECT] Host [connectivity.samsung.com.cn:443] with URL [//connectivity.samsung.com.cn:443] 08-10 23:04:42.444 I/GoLog (15871): [Info] [2276954216] app/dispatcher: taking detour [direct] for [tcp:connectivity.samsung.com.cn:443] 08-10 23:04:42.444 I/GoLog (15871): [Info] [2276954216] proxy/freedom: opening connection to tcp:connectivity.samsung.com.cn:443 08-10 23:04:42.444 I/GoLog (15871): [Info] [2276954216] transport/internet/tcp: dialing TCP to tcp:connectivity.samsung.com.cn:443 08-10 23:04:42.444 I/GoLog (15871): 127.0.0.1:58990 accepted //connectivity.samsung.com.cn:443 [http -> direct] 08-10 23:04:42.453 I/GoLog (15871): [Info] [3002739990] proxy/socks: client UDP connection from udp:127.0.0.1:37444 08-10 23:04:42.453 I/GoLog (15871): [Debug] [3002739990] proxy/socks: send packet to udp:1.1.1.1:53 with 32 bytes 08-10 23:04:42.453 I/GoLog (15871): [Debug] [3002739990] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.453 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.453 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): [Info] [3002739990] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.454 I/GoLog (15871): [Debug] [3002739990] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [1953142014] proxy/socks: client UDP connection from udp:127.0.0.1:35331 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1953142014] proxy/socks: send packet to udp:1.1.1.1:53 with 45 bytes 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1953142014] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.454 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.454 I/GoLog (15871): [Info] [1400819779] proxy/socks: client UDP connection from udp:127.0.0.1:53044 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1400819779] proxy/socks: send packet to udp:1.1.1.1:53 with 32 bytes 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1400819779] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.454 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.454 I/GoLog (15871): [Info] [1953142014] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1953142014] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [3002739990] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [1400819779] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1400819779] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [1953142014] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): [Info] [1400819779] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [1953142014] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): [Info] [1413482993] proxy/socks: client UDP connection from udp:127.0.0.1:49729 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1413482993] proxy/socks: send packet to udp:1.1.1.1:53 with 45 bytes 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1413482993] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.454 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.454 I/GoLog (15871): [Info] [1413482993] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.454 I/GoLog (15871): [Debug] [1413482993] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [1413482993] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.454 I/GoLog (15871): [Info] [3002739990] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): [Info] [1413482993] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.454 I/GoLog (15871): udp:127.0.0.1:37444 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.454 I/GoLog (15871): udp:127.0.0.1:35331 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.454 I/GoLog (15871): udp:127.0.0.1:53044 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.454 I/GoLog (15871): udp:127.0.0.1:49729 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.455 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.456 I/GoLog (15871): [Info] [2442473466] proxy/socks: client UDP connection from udp:127.0.0.1:34625 08-10 23:04:42.456 I/GoLog (15871): [Debug] [2442473466] proxy/socks: send packet to udp:1.1.1.1:53 with 32 bytes 08-10 23:04:42.456 I/GoLog (15871): [Debug] [2442473466] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.456 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.456 I/GoLog (15871): [Info] [3726948436] proxy/socks: client UDP connection from udp:127.0.0.1:39509 08-10 23:04:42.456 I/GoLog (15871): [Debug] [3726948436] proxy/socks: send packet to udp:1.1.1.1:53 with 32 bytes 08-10 23:04:42.456 I/GoLog (15871): [Debug] [3726948436] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.456 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.456 I/GoLog (15871): [Info] [3726948436] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.456 I/GoLog (15871): [Debug] [3726948436] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.456 I/GoLog (15871): [Info] [3726948436] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.456 I/GoLog (15871): udp:127.0.0.1:39509 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.456 I/GoLog (15871): [Info] [3726948436] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.458 I/GoLog (15871): udp:127.0.0.1:34625 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.458 I/GoLog (15871): [Info] [2442473466] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.458 I/GoLog (15871): [Debug] [2442473466] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.458 I/GoLog (15871): [Info] [2442473466] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.458 I/GoLog (15871): [Info] [4270516067] proxy/socks: client UDP connection from udp:127.0.0.1:54554 08-10 23:04:42.458 I/GoLog (15871): [Debug] [4270516067] proxy/socks: send packet to udp:1.1.1.1:53 with 32 bytes 08-10 23:04:42.458 I/GoLog (15871): [Debug] [4270516067] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.458 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.458 I/GoLog (15871): udp:127.0.0.1:54554 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.458 I/GoLog (15871): [Info] [4270516067] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.458 I/GoLog (15871): [Debug] [4270516067] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.458 I/GoLog (15871): [Info] [4270516067] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.459 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.459 I/GoLog (15871): [Info] [4270516067] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.459 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.459 I/GoLog (15871): [Info] [2442473466] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.462 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.462 I/GoLog (15871): [Info] [3305382774] proxy/socks: client UDP connection from udp:127.0.0.1:54208 08-10 23:04:42.462 I/GoLog (15871): [Debug] [3305382774] proxy/socks: send packet to udp:1.1.1.1:53 with 32 bytes 08-10 23:04:42.462 I/GoLog (15871): [Debug] [3305382774] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.462 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.462 I/GoLog (15871): [Info] [3305382774] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.462 I/GoLog (15871): [Debug] [3305382774] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.462 I/GoLog (15871): [Info] [3305382774] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.462 I/GoLog (15871): udp:127.0.0.1:54208 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.462 I/GoLog (15871): [Info] [3305382774] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.463 I/GoLog (15871): [Info] [3851670275] proxy/http: request to Method [GET] Host [connectivitycheck.gstatic.com] with URL [http://connectivitycheck.gstatic.com/generate_204] 08-10 23:04:42.463 I/GoLog (15871): Not Using Prepared: tcp,connectivitycheck.gstatic.com:80 08-10 23:04:42.463 I/GoLog (15871): [Info] [3851670275] app/dispatcher: taking detour [direct] for [tcp:connectivitycheck.gstatic.com:80] 08-10 23:04:42.463 I/GoLog (15871): [Info] [3851670275] proxy/freedom: opening connection to tcp:connectivitycheck.gstatic.com:80 08-10 23:04:42.463 I/GoLog (15871): [Info] [3851670275] transport/internet/tcp: dialing TCP to tcp:connectivitycheck.gstatic.com:80 08-10 23:04:42.463 I/GoLog (15871): 127.0.0.1:58992 accepted http://connectivitycheck.gstatic.com/generate_204 [http -> direct] 08-10 23:04:42.466 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.466 I/GoLog (15871): [Info] [2514070683] proxy/socks: client UDP connection from udp:127.0.0.1:47871 08-10 23:04:42.466 I/GoLog (15871): [Debug] [2514070683] proxy/socks: send packet to udp:1.1.1.1:53 with 47 bytes 08-10 23:04:42.466 I/GoLog (15871): [Debug] [2514070683] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.466 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.466 I/GoLog (15871): [Info] [2514070683] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.466 I/GoLog (15871): [Debug] [2514070683] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.466 I/GoLog (15871): [Info] [2514070683] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.466 I/GoLog (15871): udp:127.0.0.1:47871 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.466 I/GoLog (15871): [Info] [2514070683] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.468 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.468 I/GoLog (15871): [Info] [1899836487] proxy/socks: client UDP connection from udp:127.0.0.1:46716 08-10 23:04:42.469 I/GoLog (15871): [Debug] [1899836487] proxy/socks: send packet to udp:1.1.1.1:53 with 47 bytes 08-10 23:04:42.469 I/GoLog (15871): [Debug] [1899836487] transport/internet/udp: dispatch request to: udp:1.1.1.1:53 08-10 23:04:42.469 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53 08-10 23:04:42.469 I/GoLog (15871): [Info] [1899836487] app/dispatcher: taking detour [proxy] for [udp:1.1.1.1:53] 08-10 23:04:42.469 I/GoLog (15871): [Debug] [1899836487] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.469 I/GoLog (15871): [Info] [1899836487] proxy/vless/outbound: tunneling request to udp:1.1.1.1:53 via 11.4.51.4:443 08-10 23:04:42.469 I/GoLog (15871): udp:127.0.0.1:46716 accepted udp:1.1.1.1:53 [socks -> proxy] 08-10 23:04:42.469 I/GoLog (15871): [Info] [1899836487] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.613 I/GoLog (15871): [Info] [3549715772] proxy/http: request to Method [CONNECT] Host [api.telegram.org:443] with URL [//api.telegram.org:443] 08-10 23:04:42.613 I/GoLog (15871): Not Using Prepared: udp,223.5.5.5:53 08-10 23:04:42.613 I/GoLog (15871): [Debug] app/dns: domain api.telegram.org will use DNS in order: [UDP:223.5.5.5:53 UDP:1.1.1.1:53 UDP:223.5.5.5:53] 08-10 23:04:42.613 I/GoLog (15871): [Debug] app/dns: UDP:223.5.5.5:53 querying DNS for: api.telegram.org. 08-10 23:04:42.613 I/GoLog (15871): [Debug] transport/internet/udp: dispatch request to: udp:223.5.5.5:53 08-10 23:04:42.613 I/GoLog (15871): [Info] transport/internet/udp: establishing new connection for udp:223.5.5.5:53 08-10 23:04:42.613 I/GoLog (15871): [Debug] transport/internet/udp: dispatch request to: udp:223.5.5.5:53 08-10 23:04:42.613 I/GoLog (15871): [Info] app/dispatcher: taking detour [direct] for [udp:223.5.5.5:53] 08-10 23:04:42.613 I/GoLog (15871): [Info] proxy/freedom: opening connection to udp:223.5.5.5:53 08-10 23:04:42.613 I/GoLog (15871): DNS accepted udp:223.5.5.5:53 [xray.system.3ee22ddb-bdb6-44a9-bfe8-25d4b2f82b64 -> direct] 08-10 23:04:42.651 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.651 I/GoLog (15871): 127.0.0.1:58994 accepted //api.telegram.org:443 [http >> proxy] 08-10 23:04:42.658 I/GoLog (15871): [Info] app/dns: UDP:223.5.5.5:53 got answer: api.telegram.org. TypeA -> [192.133.77.133] 36.310192ms 08-10 23:04:42.658 I/GoLog (15871): [Debug] app/dns: UDP:223.5.5.5:53 updating IP records for domain:api.telegram.org. 08-10 23:04:42.659 I/GoLog (15871): [Info] app/dns: UDP:223.5.5.5:53 got answer: api.telegram.org. TypeAAAA -> [[2001::c73b:94d1]] 36.396ms 08-10 23:04:42.659 I/GoLog (15871): [Debug] app/dns: UDP:223.5.5.5:53 updating IP records for domain:api.telegram.org. 08-10 23:04:42.659 I/GoLog (15871): [Info] [3549715772] app/dispatcher: default route for tcp:api.telegram.org:443 08-10 23:04:42.659 I/GoLog (15871): [Debug] [3549715772] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.659 I/GoLog (15871): [Info] [3549715772] proxy/vless/outbound: tunneling request to tcp:api.telegram.org:443 via 11.4.51.4:443 08-10 23:04:42.659 I/GoLog (15871): [Info] [3549715772] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:42.821 I/GoLog (15871): [Debug] app/dns: domain www.google.com will use DNS in order: [UDP:223.5.5.5:53 UDP:1.1.1.1:53 UDP:223.5.5.5:53] 08-10 23:04:42.821 I/GoLog (15871): [Debug] app/dns: UDP:223.5.5.5:53 querying DNS for: www.google.com. 08-10 23:04:42.821 I/GoLog (15871): [Debug] transport/internet/udp: dispatch request to: udp:223.5.5.5:53 08-10 23:04:42.821 I/GoLog (15871): [Debug] transport/internet/udp: dispatch request to: udp:223.5.5.5:53 08-10 23:04:42.839 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:42.839 I/GoLog (15871): [Info] app/dns: UDP:223.5.5.5:53 got answer: www.google.com. TypeA -> [172.217.31.4] 18.480308ms 08-10 23:04:42.839 I/GoLog (15871): [Debug] app/dns: UDP:223.5.5.5:53 updating IP records for domain:www.google.com. 08-10 23:04:42.839 I/GoLog (15871): [Info] app/dns: UDP:223.5.5.5:53 got answer: www.google.com. TypeAAAA -> [] 18.508731ms 08-10 23:04:42.839 I/GoLog (15871): [Debug] app/dns: UDP:223.5.5.5:53 updating IP records for domain:www.google.com. 08-10 23:04:42.839 I/GoLog (15871): [Info] app/dispatcher: default route for tcp:www.google.com:80 08-10 23:04:42.839 I/GoLog (15871): [Debug] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:42.839 I/GoLog (15871): [Info] proxy/vless/outbound: tunneling request to tcp:www.google.com:80 via 11.4.51.4:443 08-10 23:04:42.839 I/GoLog (15871): [Info] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:43.324 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:43.325 I/GoLog (15871): [Info] [1839778548] proxy/socks: TCP Connect request to tcp:1.1.1.1:853 08-10 23:04:43.325 I/GoLog (15871): [Info] [1839778548] app/dispatcher: default route for tcp:1.1.1.1:853 08-10 23:04:43.325 I/GoLog (15871): [Debug] [1839778548] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:43.325 I/GoLog (15871): [Info] [1839778548] proxy/vless/outbound: tunneling request to tcp:1.1.1.1:853 via 11.4.51.4:443 08-10 23:04:43.325 I/GoLog (15871): [Info] [1839778548] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 08-10 23:04:43.325 I/GoLog (15871): tcp:127.0.0.1:60016 accepted tcp:1.1.1.1:853 [socks >> proxy] 08-10 23:04:45.439 I/GoLog (15871): Not Using Prepared: tcp,domain1.com:38704 08-10 23:04:45.441 I/GoLog (15871): [Info] [3333304131] proxy/http: request to Method [GET] Host [www.googleapis.cn] with URL [http://www.googleapis.cn/generate_204] 08-10 23:04:45.441 I/GoLog (15871): [Info] [3333304131] app/dispatcher: taking detour [proxy] for [tcp:www.googleapis.cn:80] 08-10 23:04:45.441 I/GoLog (15871): [Debug] [3333304131] app/proxyman/outbound: proxying to chain for dest tcp:11.4.51.4:443 08-10 23:04:45.441 I/GoLog (15871): [Info] [3333304131] proxy/vless/outbound: tunneling request to tcp:www.googleapis.cn:80 via 11.4.51.4:443 08-10 23:04:45.441 I/GoLog (15871): 127.0.0.1:58998 accepted http://www.googleapis.cn/generate_204 [http -> proxy] 08-10 23:04:45.441 I/GoLog (15871): [Info] [3333304131] transport/internet/tcp: dialing TCP to tcp:domain1.com:38704 ```

环境信息

android12 v2rayNG 1.7.17

额外信息(可选)

chika0801 commented 2 years ago

我从不用链式。建议一下,你就开vless tcp tls到你VPS上,VPS上写路由规则加出站(比如你开的SS2022)规则,再到你落地的VPS得了。

何必客户端写这么多了。

gsh20040816 commented 2 years ago

我从不用链式。建议一下,你就开vless tcp tls到你VPS上,VPS上写路由规则加出站(比如你开的SS2022)规则,再到你落地的VPS得了。

何必客户端写这么多了。

我是用机场中转的... vps 基本上直连已经没法用了,所以我才用链式

chika0801 commented 2 years ago

我从不用链式。建议一下,你就开vless tcp tls到你VPS上,VPS上写路由规则加出站(比如你开的SS2022)规则,再到你落地的VPS得了。 何必客户端写这么多了。

我是用机场中转的... vps 基本上直连已经没法用了,所以我才用链式

那帮不了你了。建议你买好点的VPS,交点学费花时间学点买VPS如何挑机知识,自建吧,不用机场

zhaoguomanong commented 2 years ago

最近正在用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"
            }
        ]
    }
}
gsh20040816 commented 2 years ago

最近正在用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 了。