yichya / luci-app-xray

(Almost) full feature Xray client for OpenWrt
Mozilla Public License 2.0
543 stars 317 forks source link

Configuration hook #402

Open jahboom opened 3 months ago

jahboom commented 3 months ago

Hello. In version 3.4.1r1, tlshello fragmentation does not work. From the previous request I copied the configuration and pasted in the hook section, but fragmentation does not work.

jahboom commented 3 months ago

I'm sorry, are there any other options for launching? I've been struggling with this problem for a long time.

yichya commented 2 months ago

Do you have working configurations for fragmentation? Paste here and I'll try figuring it out later.

jahboom commented 2 months ago

Do you have working configurations for fragmentation? Paste here and I'll try figuring it out later.

Of course, but the point is that the configuration will work for you without fragmentation. When I add a configuration hook as you indicated earlier, there is no response. What's with it, what's without it, there's no difference.

jahboom commented 2 months ago

We live in different countries and fragmentation parameters may also differ. For fragmentation I use the standard vless configuration via Cloudflare CDN via WS

yichya commented 2 months ago

We live in different countries and fragmentation parameters may also differ.

Just show me your configuration (without sensitive information like server addresses)

jahboom commented 2 months ago

We live in different countries and fragmentation parameters may also differ.

Just show me your configuration (without sensitive information like server addresses)

{ "dns": { "hosts": { "domain:googleapis.cn": "googleapis.com" }, "servers": [ "8.8.8.8" ] }, "inbounds": [ { "listen": "127.0.0.1", "port": 10808, "protocol": "socks", "settings": { "auth": "noauth", "udp": true, "userLevel": 8 }, "sniffing": { "destOverride": [ "http", "tls" ], "enabled": true }, "tag": "socks" }, { "listen": "127.0.0.1", "port": 10809, "protocol": "http", "settings": { "userLevel": 8 }, "tag": "http" } ], "log": { "loglevel": "warning" }, "outbounds": [ { "mux": { "concurrency": 1024, "enabled": true }, "protocol": "vless", "settings": { "vnext": [ { "address": "CDN IP", "port": 443, "users": [ { "encryption": "none", "flow": "", "id": "UUID", "level": 8, "security": "auto" } ] } ] }, "streamSettings": { "sockopt" : { "dialerProxy" : "fragment" }, "network": "ws", "security": "tls", "tlsSettings": { "allowInsecure": true, "publicKey": "", "serverName": "domain", "shortId": "", "show": false, "spiderX": "" }, "wsSettings": { "headers": { "Host": "domain" }, "path": "/path" } }, "tag": "proxy" }, { "protocol" : "freedom", "settings" : { "fragment" : { "packets" : "tlshello", "interval" : "10-10", "length" : "20-20" } }, "tag" : "fragment", "streamSettings" : { "sockopt" : { "tcpNoDelay" : true } } }, { "tag" : "direct", "protocol" : "freedom" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "block" } ], "policy": { "levels": { "8": { "connIdle": 300, "downlinkOnly": 1, "handshake": 4, "uplinkOnly": 1 } }, "system": { "statsOutboundUplink": true, "statsOutboundDownlink": true } }, "routing": { "domainStrategy": "AsIs", "rules": [ { "ip": [ "8.8.8.8" ], "outboundTag": "proxy", "port": "53", "type": "field" } ] } }

yichya commented 2 months ago

Well, this seems to need a more complicated Custom Configuration Hook to work. Try the following:

  1. Add a freedom with fragmentation enabled in Custom Configurations Hook with mark set to 253, tag it fragment. Other values come from your configuration
return function(config) {
    push(config["outbounds"], {
        "protocol": "freedom",
        "settings": {
            "fragment": {
                "packets": "tlshello",
                "interval": "10-10",
                "length": "20-20"
            }
        },
        "tag": "fragment",
        "streamSettings": {
            "sockopt": {
                "tcpNoDelay": true,
                "mark": 253
            }
        }
    });
    return config;
};
  1. Specify outbounds to use it by manually setting Dialer Proxy in Custom Configurations

image

jahboom commented 2 months ago

Well, this seems to need a more complicated Custom Configuration Hook to work. Try the following:

  1. Add a freedom with fragmentation enabled in Custom Configurations Hook with mark set to 253, tag it fragment. Other values come from your configuration
return function(config) {
    push(config["outbounds"], {
        "protocol": "freedom",
        "settings": {
            "fragment": {
                "packets": "tlshello",
                "interval": "10-10",
                "length": "20-20"
            }
        },
        "tag": "fragment",
        "streamSettings": {
            "sockopt": {
                "tcpNoDelay": true,
                "mark": 253
            }
        }
    });
    return config;
};
  1. Specify outbounds to use it by manually setting Dialer Proxy in Custom Configurations

image

I did everything as you indicated, apparently fragmentation worked, because ICMP Ping to Youtube appeared, but no page opens in the browser. When accessing HTTPS I get the error ERR_SSL_PROTOCOL_ERROR When accessing HTTP ERR_INVALID_HTTP_RESPONSE