v2ray / v2ray-core

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

404 Not Found > websocket: bad handshake] > common/retry: all retry attempts failed #3017

Closed wilia closed 2 years ago

wilia commented 2 years ago

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。 除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。 如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

1、你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)

v2rayN 5.32 + V2Ray 4.45.0(Client) + 4.45.0(Server)

2、你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。

使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频

3、你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) V2rayN客户端提示

2022/05/29 19:58:13 [Warning] [314487457] app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://www.tesdt.com/RAY1222): 404 Not Found > websocket: bad handshake] > common/retry: all retry attempts failed

4、你期待看到的正确表现是怎样的? 正常使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频浏览google 5、请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。 服务器端配置:

{ "log": { "access": "/var/log/v2ray/access.log", //访问日志路径自行修改 "error": "/var/log/v2ray/error.log", //错误日志保存路径自行修改 "loglevel": "info" //日志级别:分别有5个,推荐设定的是 warning // debug:最详细的日志信息,专用于软件调试 // info:比较详细的日志信息,可以看到 V2Ray 详细的连接信息 // warning:警告信息。轻微的问题信息,经我观察 warning 级别的信息大多是网络错误。推荐使用 warning // error:错误信息。比较严重的错误信息。当出现 error 时该问题足以影响 V2Ray 的正常运行 // none:空。不记录任何信息 }, "dns": { "servers": [ "8.8.8.8", "1.1.1.1", "localhost" ] }, "stats": {}, "api": { "tag": "api", "services": [ "HandlerService", "LoggerService", "StatsService" ] }, "inbounds": [ { "sniffing": { //流量嗅探配置 "enabled": true, "destOverride": [ "http", "tls" ] }, "tag": "tcp", //标识 "protocol": "vmess", // 主传入协议 "listen": "127.0.0.1", // 监听地址或域名 "port": 10001, //服务器监听端口 "settings": { "clients": [ { "id": "My-uuid1", // 用户 ID,客户端与服务器必须相同,推荐使用软件生成 "email": "TEST1", //用户邮箱地址,用于区分不同用户的流量。 "alterId": 0, // 防探测能力,取 30-100 之间最佳 "level": 0 //用户等级 }, { "id": "My-uuid2", "email": "TEST2",
"alterId": 0, "level": 1 }, { "id": "My-uuid3", "email": "TEST3",
"alterId": 0, "level": 1 }, { "id": "My-uuid4", "email": "TEST4", "alterId": 0, "level": 2 }, { "id": "My-uuid5", "email": "TEST5", // 临时用户1 "alterId": 0, "level": 3 }, { "id": "My-uuid6", "email": "TEST6", // 临时用户2 "alterId": 0, "level": 3 } ], "disableInsecureEncryption": false //是否禁用客户端使用不安全的加密方式 }, "streamSettings": { "network": "ws", "security": "none", "dsSettings": { "path": "/RAY1222" } } }, { "listen": "127.0.0.1", "port": 20222, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "tag": "api" } ], "inboundDetour": [ { "protocol": "shadowsocks", "address": "www.tesdt.com", "email": "Shadowsocks-Yingji", "port": 32535, "settings": { "method": "aes-256-gcm", "password": "XXX.ABCSSSS21@", "udp": true, "level": 1 } }, { "port": 15362, "protocol": "vmess", "settings": { "clients": [ { "id": "My-uuid7", "alterId": 0, "email": "Kcp-test", "security": "auto", "level": 1 } ] }, "streamSettings": { "network": "mkcp", "security": "tls", "tlsSettings": { "serverName": "www.tesdt.com", "certificates": [ { "certificateFile": "/etc/v2ray/v2ray.crt", "keyFile": "/etc/v2ray/v2ray.key" } ] }, "kcpSettings": { "uplinkCapacity": 60, //上行链路容量,将决定 V2Ray 向外发送数据包的速率。单位为 MB "downlinkCapacity": 200, //下行链路容量,将决定 V2Ray 接收数据包的速率。单位同样是 MB "congestion": true, "header": {
"type": "utp" } } } } ], "outbound": { "tag": "blocked", "protocol": "freedom", // 主传出协议 "settings": {} }, "outboundDetour": [ { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "routing": { "strategy": "rules", "settings": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "port": null, "outboundTag": "blocked", "protocol": [ "bittorrent" ], "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" ], "domain": null }, { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" } ] } }, "policy": { "levels": { "0": { "statsUserUplink": true, "statsUserDownlink": true }, "1": { "statsUserUplink": true, "statsUserDownlink": true }, "2": { "statsUserUplink": true, "statsUserDownlink": true }, "3": { "statsUserUplink": true, "statsUserDownlink": true } }, "system": { "statsUserUplink": true, "statsUserDownlink": true } }, "reverse": {}, "transport": {} }

客户端配置:

{ "policy": { "system": { "statsOutboundUplink": true, "statsOutboundDownlink": true } }, "log": { "access": "", "error": "", "loglevel": "warning" }, "inbounds": [ { "tag": "socks", "port": 1080, "listen": "127.0.0.1", "protocol": "socks", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }, "settings": { "auth": "noauth", "udp": true, "allowTransparent": false } }, { "tag": "http", "port": 1081, "listen": "127.0.0.1", "protocol": "http", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }, "settings": { "auth": "noauth", "udp": true, "allowTransparent": false } }, { "tag": "api", "port": 14796, "listen": "127.0.0.1", "protocol": "dokodemo-door", "settings": { "udp": false, "address": "127.0.0.1", "allowTransparent": false } } ], "outbounds": [ { "tag": "proxy", "protocol": "vmess", "settings": { "vnext": [ { "address": "www.tesdt.com", "port": 443, "users": [ { "id": "my-uuid1", "alterId": 0, "email": "t@t.tt", "security": "none" } ] } ] }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "allowInsecure": true, "serverName": "www.oneka.pw" }, "wsSettings": { "path": "/Citizen@2022", "headers": { "Host": "www.oneka.pw" } } }, "mux": { "enabled": false, "concurrency": -1 } }, { "tag": "direct", "protocol": "freedom", "settings": {} }, { "tag": "block", "protocol": "blackhole", "settings": { "response": { "type": "http" } } } ], "stats": {}, "api": { "tag": "api", "services": [ "StatsService" ] }, "routing": { "domainStrategy": "AsIs", "domainMatcher": "linear", "rules": [ { "type": "field", "inboundTag": [ "api" ], "outboundTag": "api", "enabled": true }, { "type": "field", "outboundTag": "proxy", "domain": [ "github.com", "githubassets.com", "githubusercontent.com", "api.themoviedb.org", "image.tmdb.org", "api.tmdb.org", "api.thetvdb.com", "www.themoviedb.org", "IMDb.com" ], "enabled": true }, { "type": "field", "outboundTag": "block", "domain": [ "mousegesturesapi.com", "cf-se.com" ], "enabled": true }, { "type": "field", "inboundTag": [], "outboundTag": "direct", "domain": [ "bitwarden.com", "bitwarden.net", "gravatar.com", "gstatic.com", "baiyunju.cc", "letsencrypt.org", "adblockplus.org", "safesugar.net", "zhangyb.fun", "oneka.pw", "bd2020.co", "btbtt17.com", "googleads.g.doubleclick.net", "adservice.google.com", "geosite:private", "geosite:cn", "geosite:adobe", "geosite:adobe-activation", "geosite:microsoft", "geosite:msn", "geosite:apple", "geosite:category-ads-all", "public-ws-ubiservices.ubi.com", "dmx.upc.ubisoft.com", "public-ubiservices.ubi.com", "public-ws-ubiservices.ubi.com", "ubistatic3-a.akamaihd.net", "overlay.cdn.ubisoft.com", "ubisoft-avatars.akamaized.net", "ubisoft-uplay-savegames.s3.amazonaws.com", "ubiservices.cdn.ubi.com", "cm6-iad1.cm.steampowered.com", "api.steampowered.com", "clientconfig.akamai.steamstatic.com", "steamcdn-a.akamaihd.net", "steam-chat.com", "store.steampowered.com", "cdn.akamai.steamstatic.com", "community.cloudflare.steamstatic.com" ], "enabled": true }, { "type": "field", "inboundTag": [], "outboundTag": "direct", "ip": [ "10.0.1.0/24", "geoip:private", "geoip:cn" ], "enabled": true }, { "type": "field", "port": "0-65535", "inboundTag": [], "outboundTag": "proxy", "domain": [ "9dmdamaomod.netquark.cn" ], "enabled": true } ] } }

nginx配置

#server { #listen 80 default_server; #listen [::]:80 default_server;

#server_name tesdt.com www.tesdt.com;

#return 301 https://$host$request_uri; #rewrite ^(.*)$ https://$host$1 permanent; #}

server { listen 443 ssl http2; listen [::]:443 ssl http2;

ssl_certificate /etc/v2ray/v2ray.crt; ssl_certificate_key /etc/v2ray/v2ray.key; ssl_session_timeout 1d; ssl_session_cache shared:MozSSL:10m; # about 40000 sessions ssl_session_tickets off;

# intermediate configuration ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off;

# HSTS (ngx_http_headers_module is required) (63072000 seconds) add_header Strict-Transport-Security "max-age=63072000" always;

server_name tesdt.com www.tesdt.com;

root /var/www/www.tesdt.com; index index.html index.htm index.nginx-debian.html;

# location / { # try_files $uri $uri/ =404; # }

location /RAY1222 { if ($http_upgrade != "websocket") { return 404; } proxy_redirect off; proxy_pass http://127.0.0.1:40001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; # Show real IP in v2ray access.log proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }

6、请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。 V2ray服务器端info级别无错误日志: nginx服务端日志如下:

26.144.207.124 - - [29/May/2022:20:06:46 +0800] "GET /RAY1222 HTTP/1.1" 404 0 "-" "Go-http-client/1.1" 26.144.207.124 - - [29/May/2022:20:06:46 +0800] "GET /RAY1222 HTTP/1.1" 404 0 "-" "Go-http-client/1.1" 26.144.207.124 - - [29/May/2022:20:06:47 +0800] "GET /RAY1222 HTTP/1.1" 404 0 "-" "Go-http-client/1.1"

v2ray客户端错误日志:

2022/05/29 19:58:13 [Warning] [314487457] app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://www.tesdt.com/RAY1222): 404 Not Found > websocket: bad handshake] > common/retry: all retry attempts failed 2022/05/29 19:58:13 [Warning] [2300423928] app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://www.tesdt.com/RAY1222): 404 Not Found > websocket: bad handshake] > common/retry: all retry attempts failed

7、请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。

8、如果 V2Ray 无法启动,请附上 --test 输出。 通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

root@clean-box-2:/var/log/v2ray$ v2ray --test --config /usr/local/etc/v2ray/config.json V2Ray 4.45.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.18.1 linux/amd64) A unified platform for anti-censorship. 2022/05/29 20:31:06 [Info] main/jsonem: Reading config: /usr/local/etc/v2ray/config.json Configuration OK.

9、如果 V2Ray 服务运行不正常,请附上 journal 日志。 运行正常 通常的命令为 journalctl -u v2ray。

onoe-serika commented 1 year ago

你好,我遇到了一样的问题,能请教一下这个改怎么处理吗?(´;︵;`)