v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.08k stars 8.94k forks source link

同一vps ss正常,v2ray有报错,failed to handler mux client connection错误 #653

Closed pplive00 closed 6 years ago

pplive00 commented 6 years ago

1) 版本:v2ray-v2.43-macos

2) 使用 Chrome 通过 Socks/VMess 代理

3) VPS使用Centos 7,部署V2ray服务端,config文件如下,其中shadowsocks 已经可以正常使用,但是vmess不能使用。 服务端config.json,且error.log 只有一句v2ray started,无其他record。

{ "log" : { "access": "/var/log/v2ray/access.log", "error": "/var/log/v2ray/error.log", "loglevel": "warning" }, "inbound": { "port": 22740, "protocol": "vmess", "settings": { "clients": [ { "id": "0385d6a7-xxxx-xxxx-bfa8-d26aexxxx40c", "level": 1, "alterId": 64 } ] } }, "inboundDetour":[ {

"port": 19000,
"protocol": "shadowsocks",
"settings": {
  "method": "aes-256-cfb",
  "password": "v2ray",
  "udp": false
   }
 }

],

"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" } ] } } }

客户端在使用SwitchyOmega代理时,会报错如下,我选择的是socks5代理 ^CTedMacBook-Pro:v2ray-v2.43-macos Ted$ ./v2ray --config config.json V2Ray v2.43 (One for all) 20171023 An unified platform for anti-censorship. 2017/10/26 21:42:56 [Debug]App|Proxyman|Inbound: creating tcp worker on 127.0.0.1:1081 2017/10/26 21:42:56 [Warning]Core: V2Ray started 2017/10/26 21:43:15 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: failed to find an available destination > Retry: [Transport|Internet|WebSocket: failed to dial WebSocket > Transport|Internet|WebSocket: failed to dial to (wss://xxx.xxx.xxx.xxx:22740/nonexistingpath1024/): > EOF] > Retry: all retry attempts failed 2017/10/26 21:43:22 [Warning]failed to handler mux client connection > Proxy|VMess|Outbound: failed to find an available destination > Retry: [Transport|Internet|WebSocket: failed to dial WebSocket > Transport|Internet|WebSocket: failed to dial to (wss://xxx.xxx.xxx.xxx:22740/nonexistingpath1024/): > EOF] > Retry: all retry attempts failed

客户端config.json

{ "log": { "loglevel": "warning" }, "inbound": { "port": 1081, "listen": "127.0.0.1", "protocol": "socks", "settings": { "auth": "noauth", "udp": false, "ip": "127.0.0.1" } }, "outbound": { "protocol": "vmess", "settings": { "vnext": [ { "address": "xxx.xxx.xxx.xxx", "port": 22740, "users": [ { "id": "0385d6a7-xxxx-xxxx-bfa8-d26aexxxx40c", "alterId": 64, "security": "aes-256-cfb" } ] } ] }, "mux": { "enabled": true }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "v2ray.cool", "allowInsecure": true }, "wsSettings": { "path": "/v2ray.cool/" } } }, "outboundDetour": [ { "protocol": "freedom", "settings": {}, "tag": "direct" } ], "dns": { "servers": [ "8.8.8.8", "8.8.4.4", "localhost" ] }, "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "port": "1-52", "outboundTag": "direct" }, { "type": "field", "port": "54-79", "outboundTag": "direct" }, { "type": "field", "port": "81-442", "outboundTag": "direct" }, { "type": "field", "port": "444-65535", "outboundTag": "direct" }, { "type": "chinasites", "outboundTag": "direct" }, { "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" } ] } } }

现在根据报错提示,很显然我这里的配置可能有问题,请教 "mux": { "enabled": true }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "v2ray.cool", "allowInsecure": true }, "wsSettings": { "path": "/v2ray.cool/" }

DarienRaymond commented 6 years ago

把服务器端的streamSettings删掉即可

pplive00 commented 6 years ago

@DarienRaymond 你好,我的服务端文件里一直都没有过 streamSettings 的配置,见上;只有客户端里有,但是客户端改成下面这样依然不行

"mux": { "enabled": true }, "streamSettings": {

}

},

pplive00 commented 6 years ago

给后人提个醒,服务端配置文件加上"streamSettings",配置留空就可以了。 我后来又看了遍说明文档,现在使用kcp,没有配ws,没有域名所以也没弄tls,现在随便用用,速度不错

cielwyh commented 6 years ago

大佬你好,求教"streamSettings"加在哪里?

anjia0532 commented 6 years ago

@cielwyh https://htfy96.github.io/v2ray-config-gen/#

cielwyh commented 6 years ago

@anjia0532 谢谢大佬

2dcon commented 5 years ago

给后人提个醒,服务端配置文件加上"streamSettings",配置留空就可以了。 我后来又看了遍说明文档,现在使用kcp,没有配ws,没有域名所以也没弄tls,现在随便用用,速度不错

感谢大佬/(ㄒoㄒ)/~~刚装了v2ray,ping得通但打不开网页,同样是报错mux。加了streamSettings就好了。

DPSDL commented 4 years ago

我直接把那个配置粘贴 过来 还是 打不开网页 加了streamSetting啊

zdlzyw commented 4 years ago

@pplive00 感谢!本地streamSettings置空就可以了,服务端没有此配置项