v2fly / v2ray-core

A platform for building proxies to bypass network restrictions.
https://v2fly.org
MIT License
28.33k stars 4.53k forks source link

V2Ray 提示 "app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination " #1873

Closed jianrry closed 1 year ago

jianrry commented 1 year ago

你正在使用哪个版本的 V2Ray?

服务端:V2Ray 4.22.1

客户端:V2Ray 4.42.2

你的使用场景是什么?

浏览网页

你看到的异常现象是什么?

无法浏览网页,有报错信息。

你期待看到的正常表现是怎样的?

可以正常浏览网页,无报错信息。

请附上你的配置

服务端配置:

// 在这里附上服务器端配置文件

{
  "log": {
    "loglevel": "warning",
    "access": "/var/log/v2ray/access.log", 
    "error": "/var/log/v2ray/error.log"
  },  
  "inbounds": [
    {
      "port": 1024,
      "listen":"127.0.0.1",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "uuid",
            "alterId": 0
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
        "path": "/v2ray"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

客户端配置:

// 在这里附上客户端配置

// 通过 V2RayN 导出为客户端配置文件
{
  "policy": {
    "system": {
      "statsOutboundUplink": true,
      "statsOutboundDownlink": true
    }
  },
  "log": {
    "access": "",
    "error": "",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "tag": "socks",
      "port": 10808,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "auth": "noauth",
        "udp": true,
        "allowTransparent": false
      }
    },
    {
      "tag": "http",
      "port": 10809,
      "listen": "127.0.0.1",
      "protocol": "http",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "udp": false,
        "allowTransparent": false
      }
    },
    {
      "tag": "api",
      "port": 59712,
      "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": "domain.com",
            "port": 443,
            "users": [
              {
                "id": "uuid",
                "alterId": 0,
                "email": "t@t.tt",
                "security": "auto"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": true,
          "serverName": "domain.com"
        },
        "wsSettings": {
          "path": "/v2ray",
          "headers": {
            "Host": "domain.com"
          }
        }
      },
      "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": "IPIfNonMatch",
    "domainMatcher": "linear",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "enabled": true
      },
      {
        "type": "field",
        "port": "0-65535",
        "outboundTag": "proxy",
        "enabled": true
      }
    ]
  }
}

请附上出错时软件输出的错误日志

服务器端错误日志:

// 在这里附上服务器端日志

2022/07/19 09:57:02 [Warning] v2ray.com/core: V2Ray 4.22.1 started

客户端错误日志:

// 在这里附上客户端日志

配置成功
[Vmess] V2Ray(v2ray***com:443)
启动服务(2022/7/19 18:35:25)...
V2Ray 4.42.2 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.17.1 windows/386)
A unified platform for anti-censorship.
2022/07/19 18:35:25 [Info] main/jsonem: Reading config: D:\Software\v2rayN-Core\config.json
2022/07/19 18:35:25 [Warning] V2Ray 4.42.2 started
2022/07/19 18:35:25 127.0.0.1:61280 accepted //mtalk.google.com:5228 [proxy]
2022/07/19 18:35:25 127.0.0.1:61281 accepted //bl3301.storage.live.com:443 [proxy]
2022/07/19 18:35:26 127.0.0.1:61286 accepted tcp:127.0.0.1:0 [api]
2022/07/19 18:35:30 127.0.0.1:61292 accepted //www.google.com:443 [proxy]
2022/07/19 18:35:30 127.0.0.1:61294 accepted //alive.github.com:443 [proxy]
2022/07/19 18:35:35 127.0.0.1:61308 accepted //alive.github.com:443 [proxy]
2022/07/19 18:35:36 [Warning] [2092548641] 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://domain.com/v2ray): 502 Bad Gateway > websocket: bad handshake] > common/retry: all retry attempts failed
2022/07/19 18:35:36 127.0.0.1:61311 accepted //mtalk.google.com:5228 [proxy]
2022/07/19 18:35:39 [Warning] [2069622245] 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://domain.com/v2ray): 502 Bad Gateway > websocket: bad handshake] > common/retry: all retry attempts failed
2022/07/19 18:35:39 127.0.0.1:61321 accepted //alive.github.com:443 [proxy]
2022/07/19 18:35:40 [Warning] [2041129081] 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://domain.com/v2ray): 502 Bad Gateway > websocket: bad handshake] > common/retry: all retry attempts failed
2022/07/19 18:35:40 127.0.0.1:61326 accepted //www.google.com:443 [proxy]
2022/07/19 18:35:41 [Warning] [1981053106] 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://domain.com/v2ray): 502 Bad Gateway > websocket: bad handshake] > common/retry: all retry attempts failed
2022/07/19 18:35:41 127.0.0.1:61330 accepted //bl3301.storage.live.com:443 [proxy]
2022/07/19 18:35:41 127.0.0.1:61333 accepted //alive.github.com:443 [proxy]
2022/07/19 18:35:44 [Warning] [1839069361] 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://domain.com/v2ray): 502 Bad Gateway > websocket: bad handshake] > common/retry: all retry attempts failed

请附上访问日志

// 在这里附上访问日志

无访问日志

其它相关的配置文件(如 Nginx)和相关日志

v2ray.conf (Nginx 配置文件)

server {

  listen 443 ssl;
  listen [::]:443 ssl;

  ssl_certificate       /path/to/cert/file;
  ssl_certificate_key   /path/to/cert/file;
  ssl_session_timeout 1d;
  ssl_session_cache shared:MozSSL:10m;
  ssl_session_tickets off;

  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;

  server_name           domain.com;

  # 与 V2Ray 配置中的 path 保持一致
  location /v2ray { 

    # WebSocket协商失败时返回404
    if ($http_upgrade != "websocket") { 
      return 404;
    }

    proxy_redirect off;

    # 假设WebSocket监听在环回地址的10000端口上
    proxy_pass http://v2ray:1024; 
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $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;

  }

  # 访问日志
  access_log  /log/domain.com.log;

}

domain.com.log (Nginx 日志文件)

162.142.125.210 - - [19/Jul/2022:10:00:00 +0000] "GET / HTTP/1.1" 404 153 "-" "-"
162.142.125.210 - - [19/Jul/2022:10:00:00 +0000] "GET / HTTP/1.1" 404 153 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)"
172.70.210.164 - - [19/Jul/2022:10:00:06 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.70.210.164 - - [19/Jul/2022:10:00:06 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.69.33.240 - - [19/Jul/2022:10:00:06 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.69.33.240 - - [19/Jul/2022:10:00:06 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.68.254.38 - - [19/Jul/2022:10:00:06 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.69.33.240 - - [19/Jul/2022:10:00:06 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.68.254.38 - - [19/Jul/2022:10:00:07 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.70.214.84 - - [19/Jul/2022:10:00:07 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.69.33.240 - - [19/Jul/2022:10:00:07 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"
172.69.33.240 - - [19/Jul/2022:10:00:07 +0000] "GET /v2ray HTTP/1.1" 502 157 "-" "Go-http-client/1.1"

docker-compose.yml (docker compose 配置文件)

version: '3'

services:

    nginx:
        # 镜像
        image: nginx
        # 容器名
        container_name: nginx        
        # 端口
        ports:
            # 80 端口
            - "80:80"
            # 443 端口
            - "443:443"
        # 数据卷    
        volumes:
            # Nginx 配置文件夹
            - "./nginx/config:/etc/nginx/conf.d"
            # Nginx 站点的根目录
            - "./nginx/html:/html"
            # Nginx 日志文件夹
            - "./nginx/log:/log"
            # SSL 证书文件夹
            - "./nginx/ssl:/ssl"
        # 在容器退出时,总是重启容器    
        restart: always 

    v2ray:
        # 镜像
        image: v2ray/official
        # 容器名
        container_name: v2ray        
        # 数据卷
        volumes:
            # V2Ray 配置文件
            - ./v2ray/config/config.json:/etc/v2ray/config.json
            # V2Ray 访问日志文件
            - ./v2ray/log/access.log:/var/log/v2ray/access.log
            # V2Ray 错误日志文件
            - ./v2ray/log/error.log:/var/log/v2ray/error.log                                   
        # 在容器退出时,总是重启容器    
        restart: always

如果 V2Ray 无法启动,请附上 --test 命令的输出

如果 V2Ray 服务运行异常,请附上 journal 日志

simplerick-simplefun commented 1 year ago

"settings": { "vnext": [ { "address": "domain.com", "port": 443, "users": [ { 这里,把address的值换成ip地址试试。 另外保证服务器上防火墙打开了443端口

jianrry commented 1 year ago

"settings": { "vnext": [ { "address": "domain.com", "port": 443, "users": [ { 这里,把address的值换成ip地址试试。 另外保证服务器上防火墙打开了443端口

谢谢大佬的回复,现在已经解决问题了。

下面的是我的解决方案,遇到同一个问题的各位可以参考一下。

报错信息:app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry

解决方案:将 "listen":"127.0.0.1" 改为 "listen":"0.0.0.0",或者直接删掉这一行。

注意事项:如果本机安装 V2Ray,则监听的 ip 是 127.0.0.1。如果通过 docker 安装 V2Ray,则监听的 ip 是 0.0.0.0

报错信息:rejected v2ray.com/core/proxy/vmess/encoding: invalid user

解决方案:将 "alterId": 0 改为 "alterId": 64

注意事项:在最新版本的 v2ray 中,这一项参数发生了变化,请参考官方的文档。

gabbi-xia commented 1 year ago

2022/08/19 14:42:19 [Warning] [686049195] 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: [dial tcp 97.64.20.122:21568: operation was canceled] > github.com/v2fly/v2ray-core/v4/common/retry: all retry attempts failed 你好,请问出现这种请问怎么解决呢?

amirhs712 commented 1 year ago

same issue here

zoeyliu1999 commented 1 year ago

"settings": { "vnext": [ { "address": "domain.com", "port": 443, "users": [ { 这里,把address的值换成ip地址试试。 另外保证服务器上防火墙打开了443端口

谢谢大佬的回复,现在已经解决问题了。

下面的是我的解决方案,遇到同一个问题的各位可以参考一下。

报错信息:app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry

解决方案:将 "listen":"127.0.0.1" 改为 "listen":"0.0.0.0",或者直接删掉这一行。

注意事项:如果本机安装 V2Ray,则监听的 ip 是 127.0.0.1。如果通过 docker 安装 V2Ray,则监听的 ip 是 0.0.0.0

报错信息:rejected v2ray.com/core/proxy/vmess/encoding: invalid user

解决方案:将 "alterId": 0 改为 "alterId": 64

注意事项:在最新版本的 v2ray 中,这一项参数发生了变化,请参考官方的文档。

你好,请问是修改本地的ip还是服务器的ip呢

anguschang007 commented 1 year ago

same issue here

change the server-side listening IP to 0.0.0.0

bwhyman commented 1 year ago

尝试同步客户端系统时间

zhuangwanlin commented 1 year ago

Qv2ray 2.7.0 v2ray 4.45.2

{ "api": { "services": [ "HandlerService", "LoggerService", "StatsService" ], "tag": "api" }, "inbounds": [ { "listen": "127.0.0.1", "port": 10809, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "tag": "api" } ], "outbounds": [ { "protocol": "freedom", "settings": {} }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "policy": { "system": { "statsInboundDownlink": true, "statsInboundUplink": true } }, "routing": { "rules": [ { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { "ip": [ "geoip:private" ], "outboundTag": "blocked", "type": "field" }, { "outboundTag": "blocked", "protocol": [ "bittorrent" ], "type": "field" } ] }, "stats": {} }

LuoPQ commented 7 months ago

请问下,我同样的配置在公司可以使用,但是在家里显示连接成功后还是无法访问,提示这个是什么原因呢 "app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination“

liutong1107 commented 7 months ago

[Warning] [469280149] 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 (ws://xn--eckuhg.xn--pckh8dr.com:60021/): > dial tcp 46.82.174.69:60021: i/o timeout transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (ws://xn--eckuhg.xn--pckh8dr.com:60021/): > dial tcp 46.82.174.69:60021: operation was canceled transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (ws://xn--eckuhg.xn--pckh8dr.com:60021/): > dial tcp: lookup xn--eckuhg.xn--pckh8dr.com: operation was canceled] > common/retry: all retry attempts failed

liutong1107 commented 7 months ago

请问这个问题怎么解决

liutong1107 commented 7 months ago

2023/11/27 23:42:38 [Info] infra/conf/serial: Reading config: D:\apphaha\V2rayN\config.json 2023/11/27 23:42:38 [Warning] core: Xray 1.5.5 started 2023/11/27 23:42:38 127.0.0.1:52400 accepted //www.un.org:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52402 accepted //www.google.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52403 accepted //www.un.org:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52401 accepted //login.live.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52404 accepted //www.google.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52405 accepted //www.google.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52406 accepted //www.google.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52407 accepted //www.google.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52408 accepted //beacons5.gvt3.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52409 accepted //mobile.events.data.microsoft.com:443 [http -> proxy] 2023/11/27 23:42:38 127.0.0.1:52420 accepted //data.hicloud.com:8443 [http -> block] 2023/11/27 23:42:38 127.0.0.1:52421 accepted //data.hicloud.com:8443 [http -> block] 2023/11/27 23:42:38 127.0.0.1:52422 accepted //data.hicloud.com:8443 [http -> block] 2023/11/27 23:42:38 127.0.0.1:52423 accepted //data.hicloud.com:8443 [http -> block] 2023/11/27 23:42:38 127.0.0.1:52424 accepted //data.hicloud.com:8443 [http -> block] 2023/11/27 23:42:50 [Warning] [2342193011] app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry: [dial tcp 127.0.0.1:54321: connectex: No connection could be made because the target machine actively refused it.] > common/retry: all retry attempts failed

XiGou commented 6 months ago

@liutong1107 这玩意原因很简单, 你的 ip 和端口被封锁

测试方法,本地打开 terminal ,运行 telnet ip port

查看是否正常连接,如果不能则是被封

改IP,改端口,开放新的防火墙规则可解

lijunle commented 5 months ago

我使用xray,遇到同样的问题,最后解决是指定certificateFile的时候,需要使用fullchain.crt

我在浏览器打开是trusted,手机用移动流量没有问题,但是电信在OpenWRT curl就是不trust,直到修改为 fullchain。

https://xtls.github.io/document/level-0/ch07-xray-server.html#_7-4-%E9%85%8D%E7%BD%AE-xray

athosss commented 3 months ago

v2rayN 该报错解决方法:设置-参数设置-默认跳过证书验证-开启

这个问题就解决了

slowdive42 commented 2 months ago

我也是同样的报错"app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination "。我在客户端的设置里面打开“允许来自局域网的连接”就好了。

Fwq2002 commented 1 month ago

求助!看不懂是什么毛病,只能在启动服务的瞬间上一下网,之后一直断连,有没有大佬指点一下 2024/05/12 13:19:39 [Info] [3392566488] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled 2024/05/12 13:19:39 [Info] [3392566488] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/trojan: connection ends > context canceled 2024/05/12 13:19:46 [Info] [845984922] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled 2024/05/12 13:19:46 [Info] [144035548] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled 2024/05/12 13:19:46 [Info] [2574150064] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled 2024/05/12 13:19:46 [Info] [112801028] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > context canceled 2024/05/12 13:19:46 [Info] [845984922] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/trojan: connection ends > context canceled 2024/05/12 13:19:46 [Info] [144035548] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/trojan: connection ends > context canceled 2024/05/12 13:19:46 [Info] [2574150064] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/trojan: connection ends > context canceled 2024/05/12 13:19:46 [Info] [112801028] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/trojan: connection ends > context canceled