Skip to content

WireGuard outbound problem in tun_linux #5848

@Kapkap5454

Description

@Kapkap5454

Integrity requirements

  • I have read all the comments in the issue template and ensured that this issue meet the requirements.
  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
  • I searched issues and did not find any similar issues.
  • The problem can be successfully reproduced in the latest Release

Description

Xray 26.3.23 + v2rayN 7.19.5 TUN + Windows 10. XHTTP + Reality.
After updating:

  1. I have persistent connection to one of the servers using mosh console (uses UDP). It can't connect after update. It doesn't connect even when starting new connection.
  2. https://quic.nginx.org/ test shows no QUIC connection in browser after update. Before update it worked.

I can't confirm it breaks all UDP, but at least some.
Wireshark shows outgoing packets for the server i am trying to reach via mosh, but no incoming.

Happens only if both client and server are updated. Problem doesn't appear when server xray remains old and client is updated (probably also would work vice-versa? didn't test that).

*weird, client logs show it even accepted something from target address?

I truncated client log a little, as v2rayN on latest versions started to produce many error messages, connected with new tun protect mode. But i tested and have this bug even on older v2rayN 7.18.0.

Reproduction Method

  1. Update Xray.
  2. Try using mosh to connect to server or try https://quic.nginx.org/. No connection and no QUIC.

Client config

Details

{
  "log": {
    "loglevel": "debug"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 49371,
      "protocol": "shadowsocks",
      "settings": {
        "network": "tcp,udp",
        "method": "none",
        "password": "none"
      },
      "tag": "proxy-relay-ss"
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "11.11.111.11",
            "port": 443,
            "users": [
              {
                "id": "d62",
                "email": "t@t.tt",
                "security": "auto",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "xhttp",
        "security": "reality",
        "xhttpSettings": {
          "path": "/lalala",
          "mode": "stream-one"
        },
        "realitySettings": {
          "serverName": "www.somesite.com",
          "fingerprint": "chrome",
          "show": false,
          "publicKey": "ZY",
          "shortId": "",
          "spiderX": "",
          "mldsa65Verify": ""
        },
        "sockopt": {
          "dialerProxy": "tun-protect-ss"
        }
      },
      "mux": {
        "enabled": false,
        "concurrency": -1
      }
    },
    {
      "tag": "tun-protect-ss",
      "protocol": "shadowsocks",
      "settings": {
        "servers": [
          {
            "address": "127.0.0.1",
            "method": "none",
            "ota": false,
            "password": "none",
            "port": 49368,
            "level": 1
          }
        ]
      },
      "streamSettings": {
        "network": "tcp"
      },
      "mux": {
        "enabled": false,
        "concurrency": -1
      }
    }
  ],
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api"
      },
      {
        "type": "field",
        "inboundTag": [
          "proxy-relay-ss"
        ],
        "outboundTag": "proxy"
      }
    ]
  }
}

Server config

Details

{
  "log": {
    "loglevel": "debug",
    "access": "/var/log/xray/access.log",
    "error": "/var/log/xray/error.log"
  },
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "tag": "reality-in",
      "settings": {
        "clients": [
          {
            "id": "d62",
            "email": "user1",
            "flow": "xtls-rprx-vision"
          }
        ],
        "decryption": "none",
        "fallbacks": [
          {
            "dest": "@xhttp",
            "xver": 1
          }
        ]
      },
      "streamSettings": {
        "network": "raw",
        "security": "reality",
        "realitySettings": {
          "show": false,
          "target": "www.somesite.com:443",
          "xver": 0,
          "serverNames": [
            "www.somesite.com",
          ],
          "privateKey": "INA",
          "minClientVer": "",
          "maxClientVer": "",
          "maxTimeDiff": 0,
          "shortIds": [""]
        }
      }
    },
    {
      "listen": "@xhttp",
      "protocol": "vless",
      "tag": "reality-in-xhttp",
      "settings": {
        "clients": [
          {
            "id": "d62",
            "email": "user1"
          }        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "xhttp",
        "sockopt": {
          "acceptProxyProtocol": true
        },
        "xhttpSettings": {
          "path": "/lalala"
        }
      }
    },
  "outbounds": [
    {
     "protocol": "freedom",
     "tag": "direct"
    },
  ]
}

Client log

Details

2026/03/26 13:08:28.949481 [Info] [2906361306] transport/internet/splithttp: XHTTP is dialing to tcp:11.11.111.11:443, mode stream-one, HTTP version 2, host www.somesite.com
2026/03/26 13:08:28.949512 [Info] [2906361306] proxy/vless/outbound: tunneling request to udp:99.99.999.999:60001 via 11.11.111.11:443
2026/03/26 13:08:31.956522 [Info] [2906361306] proxy/shadowsocks: tunnelling request to udp:99.99.999.999:60001
2026/03/26 13:08:31.956522 [Debug] [2906361306] transport/internet/udp: dispatch request to: udp:99.99.999.999:60001
2026/03/26 13:08:31.956522 [Info] [2906361306] transport/internet/udp: establishing new connection for udp:99.99.999.999:60001
2026/03/26 13:08:31.956522 [Info] [2906361306] app/dispatcher: taking detour [proxy] for [udp:99.99.999.999:60001]
2026/03/26 13:08:31.956522 from udp:127.0.0.1:63615 accepted udp:99.99.999.999:60001 [proxy-relay-ss -> proxy]
2026/03/26 13:08:34.966868 [Info] [1789288886] app/dispatcher: taking detour [proxy] for [udp:99.99.999.999:60001]
2026/03/26 13:08:55.280919 [Info] [2584618876] app/proxyman/inbound: connection ends > proxy/shadowsocks: connection ends > context canceled

Server log

Details

2026/03/26 11:30:23.534565 [Info] [2726084989] proxy/vless/inbound: received request for tcp:v1.mux.cool:0
2026/03/26 11:30:23.534572 [Info] [2726084989] common/mux: received request for udp:99.99.999.999:60001
2026/03/26 11:30:23.534599 [Info] [2726084989] common/mux: XUDP new [8 113 212 83 181 7 103 79]
2026/03/26 11:30:23.534603 [Info] [2726084989] app/dispatcher: default route for udp:99.99.999.999:60001
2026/03/26 11:30:23.534607 [Info] [2726084989] app/proxyman/outbound: app/proxyman/outbound: failed to process outbound traffic > proxy/wireguard: connection ends > write udp 172.16.0.2:58553->99.99.999.999:60001: use of WriteTo with pre-connected connection
2026/03/26 11:30:23.534612 [Info] [2726084989] common/mux: session 0 ends. > io: read/write on closed pipe
2026/03/26 11:30:23.534616 [Debug] common/mux: XUDP put [8 113 212 83 181 7 103 79]
2026/03/26 11:30:23.559866 [Info] [2726084989] common/mux: unexpected EOF > common/mux: failed to read metadata > stream error: stream ID 139; CANCEL
2026/03/26 11:30:23.992583 [Info] [4104545062] proxy/vless/inbound: firstLen = 54

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions