shadowsocks / shadowsocks-rust

A Rust port of shadowsocks
https://shadowsocks.org/
MIT License
8.67k stars 1.18k forks source link

Question about UDP_ONLY mode with gfwlist.acl #1635

Closed AaronChen0 closed 2 months ago

AaronChen0 commented 2 months ago

Hi, I have the following scenario of using sslocal. Related to https://github.com/shadowsocks/shadowsocks-android/issues/3070. Having 2 sslocal instance with the same config, the only difference is that one is tcp_only and the other one is udp_only.

sslocal -b "127.0.0.1:1080" -s "1.1.1.1:12345" -m "aes-256-gcm" -k "hello-kitty" --acl acl.txt
sslocal -u -b "127.0.0.1:1080" -s "1.1.1.1:12345" -m "aes-256-gcm" -k "hello-kitty" --acl acl.txt

With a proxy-all acl, the remote server can receive both tcp traffic and quic/udp traffic. But with a gfwlist acl, only tcp traffic is received, no quic/udp traffic. Tested with visiting youtube for quic/udp traffic. Why?

zonyitoo commented 2 months ago

Run with -vvv and see what exactly was happening.

AaronChen0 commented 2 months ago

The tcp-only sslocal config is like this,

{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 1080,
        "local_udp_address": "127.0.0.1",
            "local_udp_port": 1080,
        "mode": "tcp_only"
        },
    {
        "protocol":"dns",
        "local_address": "127.0.0.1",
        "local_port": 5450,
        "local_dns_address": "local_dns_path",
        "remote_dns_address": "dns.google",
        "remote_dns_port": 53
    }
    ],
    "mode": "tcp_only",
    "server": "1.1.1.1",
    "server_port": 12345,
    "password": "xxxxxx",
    "method": "aes-256-gcm",
    "dns": "system"
}

The udp-only sslocal config is like this,

{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 1080,
        "local_udp_address": "127.0.0.1",
            "local_udp_port": 1080,
        "mode": "udp_only"
        }
    ],
    "mode": "udp_only",
    "server": "1.1.1.1",
    "server_port": 12345,
    "password": "xxxxxx",
    "method": "aes-256-gcm",
    "dns": "system"
}

And both sslocal instances are started by :

sslocal -c config.json --vpn --acl acl.txt
AaronChen0 commented 2 months ago

It might be hard to debug without using an android device. And this issue is a peculiar use of sslocal. I will close this issue and leave it to shadowsocks-android project. Thank you for your time.