v2fly / v2ray-core

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

Packets won’t be sent over QUIC if quicSettings is not defined #1744

Closed arinc9 closed 1 year ago

arinc9 commented 2 years ago

What version of V2Ray are you using?

4.44.0 (dev-v4main)

What problems have you encountered?

quicSettings has to be defined or the packets won’t be transmitted over QUIC. If it’s not defined, Wireshark detects them as regular UDP packets. Packet capture below. Renamed from pcapng. Packet capture for outbound2 after running nc -v 127.0.0.1 51821 udp.log Packet capture for outbound3 after running nc -v 127.0.0.1 51822 quic.log

What's your expectation?

For the packet to be transmitted over QUIC.

This is more of a question than a bug report. There isn't an option to encapsulate packets under UDP, only QUIC. Is this a hidden way to encapsulate packets under UDP rather than QUIC?

Please attach your configuration here

Server configuration:

{
  "log": {
    "loglevel": "info"
  },
  "inbounds": [
    {
      "port": 19234,
      "protocol": "socks",
      "settings": {
        "auth": "password",
        "accounts": [
          {
            "user": "<username>",
            "pass": "<password>"
          }
        ]
      },
      "streamSettings": {
        "network": "quic"
      }
    },
    {
      "port": 19235,
      "protocol": "socks",
      "settings": {
        "auth": "password",
        "accounts": [
          {
            "user": "<username>",
            "pass": "<password>"
          }
        ]
      },
      "streamSettings": {
        "network": "quic",
        "quicSettings": {}
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

Client configuration:

{
  "log": {
    "loglevel": "info"
  },
  "routing": {
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "inbound2"
        ],
        "outboundTag": "outbound2"
      },
      {
        "type": "field",
        "inboundTag": [
          "inbound3"
        ],
        "outboundTag": "outbound3"
      }
    ]
  },
  "inbounds": [
    {
      "tag": "inbound2",
      "port": 51821,
      "listen": "127.0.0.1",
      "protocol": "dokodemo-door",
      "settings": {
        "address": "1.1.1.1",
        "port": 80,
        "network": "tcp"
      }
    },
    {
      "tag": "inbound3",
      "port": 51822,
      "listen": "127.0.0.1",
      "protocol": "dokodemo-door",
      "settings": {
        "address": "1.1.1.1",
        "port": 80,
        "network": "tcp"
      }
    }
  ],
  "outbounds": [
    {
      "tag": "outbound2",
      "protocol": "socks",
      "settings": {
        "servers": [
          {
            "address": "<IP>",
            "port": 19234,
            "users": [
              {
                "user": "<username>",
                "pass": "<password>"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "quic"
      }
    },
    {
      "tag": "outbound3",
      "protocol": "socks",
      "settings": {
        "servers": [
          {
            "address": "<IP>",
            "port": 19235,
            "users": [
              {
                "user": "<username>",
                "pass": "<password>"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "quic",
        "quicSettings": {}
      }
    }
  ]
}

Client Log

V2Ray 4.44.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.17.3 linux/amd64)
A unified platform for anti-censorship.
2022/04/25 15:55:35 [Info] main/jsonem: Reading config: client-socks-udp.json
2022/04/25 15:55:35 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:51821
2022/04/25 15:55:35 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:51822
2022/04/25 15:55:35 [Warning] V2Ray 4.44.0 started
2022/04/25 15:55:37 [Info] [2489107323] proxy/dokodemo: received request for 127.0.0.1:34362
2022/04/25 15:55:37 [Info] [2489107323] app/dispatcher: taking detour [outbound2] for [tcp:1.1.1.1:80]
2022/04/25 15:55:37 127.0.0.1:34362 accepted tcp:1.1.1.1:80 [outbound2]
2022/04/25 15:55:37 connection doesn't allow setting of receive buffer size. Not a *net.UDPConn?. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
V2Ray 4.44.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.17.3 linux/amd64)
A unified platform for anti-censorship.
2022/04/25 16:00:03 [Info] main/jsonem: Reading config: client-socks-udp.json
2022/04/25 16:00:03 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:51821
2022/04/25 16:00:03 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:51822
2022/04/25 16:00:03 [Warning] V2Ray 4.44.0 started
2022/04/25 16:00:05 [Info] [3537381852] proxy/dokodemo: received request for 127.0.0.1:53328
2022/04/25 16:00:05 [Info] [3537381852] app/dispatcher: taking detour [outbound3] for [tcp:1.1.1.1:80]
2022/04/25 16:00:05 127.0.0.1:53328 accepted tcp:1.1.1.1:80 [outbound3]
2022/04/25 16:00:05 connection doesn't allow setting of receive buffer size. Not a *net.UDPConn?. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
arinc9 commented 2 years ago

This behaviour still exists on 5.0.6.

Edit: This is without using the jsonv5 format as quic is not supported as a transport method yet.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

arinc9 commented 2 years ago

Keep it open.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

arinc9 commented 1 year ago

Keep until I try it on the latest version.

Kylejustknows commented 1 year ago

I confirm this issue. And it is getting worse for QUIC. Since an unknown version, all QUIC on android core compilations is somehow "disabled"... (copy/paste the same config, it works on all PCs, but failed on all Androids. There is no any error log, feels like the "Android QUIC Outbound" doesn't even exist.)

There is not much attention from devs looking into QUIC it seems, even though today QUIC is the ONLY reliable UDP transport built-in V2ray, with many advantages like blending in everyday internet traffic and fast speed.

(Please forget about the buggy mKCP which can burn 100GB bandwidth data for a 10MB speedtest run, slows down everything and got UDP DDoS attack warning/blocking from ISP etc etc. mKCP is a panic solution, not a reliable UDP transport like QUIC.)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days