yichya / luci-app-xray

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

config.json #397

Open nomoresat opened 7 months ago

nomoresat commented 7 months ago

How can I add and use custom configuration as a direct config.json (e.g. to use fragmentation)

yichya commented 6 months ago

Currently it is recommended to use Custom Configuration Hook to manipulate specific outbounds directly.

For example to change fragmentation settings:

return function(config) {
    for (let i = 0; i < length(config["outbounds"]); i++) {
        if (config["outbounds"][i]["tag"] === "direct") {
            config["outbounds"][i]["settings"]["fragment"] = {
                "packets": "tlshello",
                "length": "100-200",
                "interval": "10-20" // unit in ms
            };
            break;
        };
    };
    return config;
};
nomoresat commented 6 months ago

Pardon my stupidity, but where and how do I add it?

yichya commented 6 months ago

Pardon my stupidity, but where and how do I add it?

image

nomoresat commented 6 months ago

But there's no fragmentation parameter

nomoresat commented 6 months ago

Pardon my stupidity, but where and how do I add it?

image

Снимок экрана (1)

nomoresat commented 6 months ago

When I paste the data you provided, it says invalid synaxis ![Uploading Снимок экрана (2).png…]()

yichya commented 6 months ago

It seems you're using a very outdated version. Follow the instructions to install a newer version.

nomoresat commented 6 months ago

The instructions are pretty complicated for a beginner, couldn't figure it out(

It seems you're using a very outdated version. Follow the instructions to install a newer version.

yichya commented 6 months ago

The instructions are pretty complicated for a beginner, couldn't figure it out(

Just find someone else's fork there:

https://github.com/yichya/luci-app-xray/forks?include=active&page=1&period=2y&sort_by=last_updated

jahboom commented 6 months ago

Unfortunately, only old versions are in forks.

jahboom commented 6 months ago

The instructions are pretty complicated for a beginner, couldn't figure it out(

Just find someone else's fork there:

https://github.com/yichya/luci-app-xray/forks?include=active&page=1&period=2y&sort_by=last_updated

I built the latest package using actions, version 3.4.1r1 was released and it does not have a custom configuration hook.