A-A+

v2ray failed to dial WebSocket 解决方法_ find an available destination

2021年07月20日 09:43 学习笔记 评论 8 条 共3447字 (阅读57,707 views次)
Image

【注意:此文章为博主原创文章!转载需注意,请带原文链接,至少也要是txt格式!】

今天最近使用v2ray经常遇到下面的情况,简直是一脸蒙圈,有的时候过很长一阵时间就好了,然后又不好了,今天则是彻底就一直这种状况。下面就说一下这种问题的解决方案。

2021/07/20 08:59:47 [Warning] [1125995626] github.com/v2fly/v2ray-core/v4/app/proxyman/outbound: failed to process outbound traffic > github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound: failed to find an available destination > github.com/v2fly/v2ray-core/v4/common/retry: [github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial WebSocket > github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial to (wss://xxx.xx.xx.xx:443/search):  > dial tcp xxx.xx.xx.xx:443: connectex: No connection could be made because the target machine actively refused it.] > github.com/v2fly/v2ray-core/v4/common/retry: all retry attempts failed
2021/07/20 08:59:47 tcp:127.0.0.1:51035 accepted tcp:sdk.split.io:443 [proxy]
2021/07/20 08:59:58 [Warning] [59391995] github.com/v2fly/v2ray-core/v4/app/proxyman/outbound: failed to process outbound traffic > github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound: failed to find an available destination > github.com/v2fly/v2ray-core/v4/common/retry: [github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial WebSocket > github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial to (wss://xxx.xx.xx.xx:443/search):  > dial tcp xxx.xx.xx.xx:443: connectex: No connection could be made because the target machine actively refused it. github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial WebSocket > github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial to (wss://xxx.xx.xx.xx:443/search):  > dial tcp xxx.xx.xx.xx:443: operation was canceled] > github.com/v2fly/v2ray-core/v4/common/retry: all retry attempts failed
2021/07/20 08:59:58 [Warning] [2497832095] github.com/v2fly/v2ray-core/v4/app/proxyman/outbound: failed to process outbound traffic > github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound: failed to find an available destination > github.com/v2fly/v2ray-core/v4/common/retry: [github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial WebSocket > github.com/v2fly/v2ray-core/v4/transport/internet/websocket: failed to dial to (wss://xxx.xx.xx.xx:443/search):  > dial tcp xxx.xx.xx.xx:443: connectex: No connection could be made because the target machine actively refused it.] > github.com/v2fly/v2ray-core/v4/common/retry: all retry attempts failed

解决方案:

第一步:判断当前VPS主机时间是否有问题。判断方法参考“v2ray 主机时间同步问题”,如果确定没问题,则进行下一步,如果有问题则按照文章中的步骤同步一下时间即可。然后再次尝试v2ray客户端连接,看看还会不会报错,如果还是会报错,则进行第二步判断。

 

第二步:判断当前VPS主机端口是否有问题。首先安装一个nc

 

yum install -y nc

安装完后,随意开启监听一个端口,例如直接执行下面的命令。监听8181

nc -lv -p 8181

然后在本机打开cmd,尝试连接一下VPS的8181端口

telnet xxx.你VPS的IP.xx.xx 8181

如果没连进去,这里就要分析多种可能了。
例如:1、可能是你VPS没有关闭防火墙
2、可能是你电脑网络没办法访问互联网其他主机的端口,可能公司限制
3、你的VPS被墙了,只能考虑使用CloudFlare来做中转帮你自己恢复被墙的限制(CloudFlare恢复被墙方法)

如果没问题,那么你要注意以下你的V2RAY的配置,是否使用的WebSocket+TLS模式,或者你v2ray对外开放的是什么端口。是什么端口,你连接一下什么端口。WebSocket+TLS这个默认是443 你继续在你的电脑中telnet连接一下,我这边尝试连接我自己的VPS结果就是443端口是不通的,其他任何端口都没问题。

那就只能证明一个结果,我VPS的IP的443端口被墙了,所以只能更换其他端口。v2ray WebSocket+TLS 模式更换其他端口的方法如下:

vi /etc/caddy/Caddyfile
##注意,里面的内容第一行,绝对是你自己配置的域名,这里更改为如下,英文冒号,端口随意设置
www.你自己配置的域名.com:8080 {
    gzip
timeouts none
    proxy / https://www.baidu.com {
        except /ddd
    }
    proxy /ddd 127.0.0.1:40507 {
        without /ddd
        websocket
    }
}
http://www.你自己配置的域名.com {
    gzip
timeouts none
    proxy / https://woj.app {
    }
}
import sites/*

然后你使用v2ray 客户端连接的时候,把443端口更改成你设定的端口即可。例如我这里面设定的是8080,我更改为8080就搞定了。
后续就可以正常使用v2ray啦。

最新caddy的设置如下:

ltang.suning.com {
    reverse_proxy https://fanyi.baidu.com {
        header_up Host {upstream_hostport}
        header_up X-Forwarded-Host {host}
    }
    handle_path /search {
        reverse_proxy 127.0.0.1:20363
    }
}
http://ltang.suning.com {
    reverse_proxy  / https://woj.app {
    }
}
import sites/*

布施恩德可便相知重

微信扫一扫打赏

Image

支付宝扫一扫打赏

Image
×
Image

8 条留言  访客:6 条  博主:2 条

  1. Image ethan

    全部都试过了,telnet端口也都通的,还是提示这个错误,无语了,重装了很多遍,不知道咋办了…

    • Image xl123

      你现在好了吗,我也是

      • Image jesus$chirts

        是不是客户端的端口没改?我是这样的

  2. Image xiaohui

    非常感谢您的教程,按照您的教程,我成功解决了问题,非常感谢

  3. Image gdd

    status 403 {rn /.htaccessrn /datarn /configrn /db_structurern /.xmlrn /READMErn }

  4. Image 达拉崩吧

    请问有更详细一点的答案吗。没看明白caddy下面是怎么修改的

    • Image gdd

      最下面的 caddy 只是给大家的一个示例,你可以不用理会

  5. Image ss

    没有VPS主机,只有V2RayN软件,也显示这个错误,怎么回事啊,是节点无效吗

给我留言

Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image