Closed wansenlyt closed 7 years ago
通过Nginx监听443转8888端口,可以正常连通和上网,但直接连接VPS的8964端口却不能连通,提示错误:
Proxy|VMess|Outbound: failed to find an available destination > Retry: [dial tcp xx.xx.xx.xx:8008: connectex: No connection could be made because the target machine actively refused it.] > Retry: all retry attempts failed
{ "log": { "access": "/var/log/v2ray/access.log", "error": "/var/log/v2ray/error.log", "loglevel": "warning" }, "inbound": { "port": 8964, //推荐80端口,更好地迷惑防火墙(好吧实际上并没有什么卵用 "protocol": "vmess", "settings": { "clients": [ { "id": "0b700b51-3b83-4fa3-806c-d7f53fc605d5", "level": 1, "alterId": 64 } ] }, "streamSettings": { "network": "tcp", "tcpSettings": { "header": { // header 这一项是关于数据包伪装的设置,可自定义合理的内容,但要确保服务器与客户端一致 "type": "http", "response": { "version": "1.1", "status": "200", "reason": "OK", "headers": { "Content-Type": ["application/octet-stream", "application/x-msdownload", "text/html", "application/x-shockwave-flash"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Pragma": "no-cache" } } } } } }, "inboundDetour": [ { "port": 8888,//备用协议,推荐80端口,更好地迷惑防火墙(好吧实际上并没有什么卵用 "listen":"0.0.0.0", "protocol": "vmess", "settings": { "clients": [ { "id": "0b700b51-3b83-4fa3-806c-d7f53fc605d5", "level": 1, "alterId": 64 } ] }, "streamSettings": { "network": "ws", "wsSettings": { "connectionReuse": true, "path": "/", "headers": { "Host": "www.icloud.com" } } } } ], "outbound": { "protocol": "freedom", // 主传出协议 "settings": {} }, "outboundDetour": [ { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "routing": { "strategy": "rules", "settings": { "rules": [ { "type": "field", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "outboundTag": "blocked" } ] } } }
{ "log": { "loglevel": "warning" }, "inbound": { "port": 1080, // 监听端口 "protocol": "socks", // 入口协议为 SOCKS 5 "settings": { "auth": "noauth" //socks的认证设置,noauth 代表不认证,由于 socks 通常在客户端使用,所以这里不认证 } }, "outbound": { "protocol": "vmess", // 出口协议 "settings": { "vnext": [ { "address": "xx.xx.xx.xx", // 服务器地址,请修改为你自己的服务器 ip 或域名 "port": 8964, // 服务器端口 "users": [ { "id": "0b700b51-3b83-4fa3-806c-d7f53fc605d5", // 用户 ID,必须与服务器端配置相同 "alterId": 64 // 此处的值也应当与服务器相同 } ] } ] }, "streamSettings": { "network": "tcp", "tcpSettings": { "header": { //这里的 header 要与服务器保持一致 "type": "http", "request": { "version": "1.1", "method": "GET", "path": ["/"], "headers": { "Host": [ "www.icloud.com" ], "User-Agent": [ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36", "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46" ], "Accept-Encoding": ["gzip, deflate"], "Connection": ["keep-alive"], "Pragma": "no-cache" } } } } } }, "inboundDetour": [ { "port": 1088,// 备用监听端口 "listen": "127.0.0.1", "protocol": "http",// 备用入口协议为 http "settings": { "timeout": 30 } } ], "outboundDetour": [ { "protocol": "freedom", "settings": {}, "tag": "direct" } ], "dns": { "hosts": { "v2ex.com": "119.29.29.29", "v2ex.co": "119.29.29.29" }, "servers": [ "localhost" ] }, "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "outboundTag": "direct" }, { "type": "chinaip", "outboundTag": "direct" } ] } } }
请高手帮助看看,是服务器端配置错误,还是客户端错误,谢谢!
后来按https://toutyrater.github.io/advanced/httpfake.html例子,重新配置v2ray,vps未初始化,也是不能联通,估计是VPS一旦建立加密连接后,就不能再使用非加密连接进行连接。 请问还有没有什么办法可以解决这个问题?谢谢。
通过Nginx监听443转8888端口,可以正常连通和上网,但直接连接VPS的8964端口却不能连通,提示错误:
Proxy|VMess|Outbound: failed to find an available destination > Retry: [dial tcp xx.xx.xx.xx:8008: connectex: No connection could be made because the target machine actively refused it.] > Retry: all retry attempts failed
VPS配置如下:
{ "log": { "access": "/var/log/v2ray/access.log", "error": "/var/log/v2ray/error.log", "loglevel": "warning" }, "inbound": { "port": 8964, //推荐80端口,更好地迷惑防火墙(好吧实际上并没有什么卵用 "protocol": "vmess", "settings": { "clients": [ { "id": "0b700b51-3b83-4fa3-806c-d7f53fc605d5", "level": 1, "alterId": 64 } ] }, "streamSettings": { "network": "tcp", "tcpSettings": { "header": { // header 这一项是关于数据包伪装的设置,可自定义合理的内容,但要确保服务器与客户端一致 "type": "http", "response": { "version": "1.1", "status": "200", "reason": "OK", "headers": { "Content-Type": ["application/octet-stream", "application/x-msdownload", "text/html", "application/x-shockwave-flash"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Pragma": "no-cache" } } } } } }, "inboundDetour": [ { "port": 8888,//备用协议,推荐80端口,更好地迷惑防火墙(好吧实际上并没有什么卵用 "listen":"0.0.0.0", "protocol": "vmess", "settings": { "clients": [ { "id": "0b700b51-3b83-4fa3-806c-d7f53fc605d5", "level": 1, "alterId": 64 } ] }, "streamSettings": { "network": "ws", "wsSettings": { "connectionReuse": true, "path": "/", "headers": { "Host": "www.icloud.com" } } } } ], "outbound": { "protocol": "freedom", // 主传出协议 "settings": {} }, "outboundDetour": [ { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "routing": { "strategy": "rules", "settings": { "rules": [ { "type": "field", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "outboundTag": "blocked" } ] } } }
客户端8964端口配置如下:
{ "log": { "loglevel": "warning" }, "inbound": { "port": 1080, // 监听端口 "protocol": "socks", // 入口协议为 SOCKS 5 "settings": { "auth": "noauth" //socks的认证设置,noauth 代表不认证,由于 socks 通常在客户端使用,所以这里不认证 } }, "outbound": { "protocol": "vmess", // 出口协议 "settings": { "vnext": [ { "address": "xx.xx.xx.xx", // 服务器地址,请修改为你自己的服务器 ip 或域名 "port": 8964, // 服务器端口 "users": [ { "id": "0b700b51-3b83-4fa3-806c-d7f53fc605d5", // 用户 ID,必须与服务器端配置相同 "alterId": 64 // 此处的值也应当与服务器相同 } ] } ] }, "streamSettings": { "network": "tcp", "tcpSettings": { "header": { //这里的 header 要与服务器保持一致 "type": "http", "request": { "version": "1.1", "method": "GET", "path": ["/"], "headers": { "Host": [ "www.icloud.com" ], "User-Agent": [ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36", "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46" ], "Accept-Encoding": ["gzip, deflate"], "Connection": ["keep-alive"], "Pragma": "no-cache" } } } } } }, "inboundDetour": [ { "port": 1088,// 备用监听端口 "listen": "127.0.0.1", "protocol": "http",// 备用入口协议为 http "settings": { "timeout": 30 } } ], "outboundDetour": [ { "protocol": "freedom", "settings": {}, "tag": "direct" } ], "dns": { "hosts": { "v2ex.com": "119.29.29.29", "v2ex.co": "119.29.29.29" }, "servers": [ "localhost" ] }, "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "outboundTag": "direct" }, { "type": "chinaip", "outboundTag": "direct" } ] } } }
请高手帮助看看,是服务器端配置错误,还是客户端错误,谢谢!