feat(modules): expose min-chunk, max-chunk, delay-us, extraArgs as Nix options
Allows tuning fragmentation parameters for performance. Defaults match CLI defaults (min 3, max 8, delay 500us).
This commit is contained in:
parent
50521e8dbd
commit
02f9817e57
3 changed files with 30 additions and 4 deletions
|
|
@ -12,9 +12,10 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
launchd.user.agents.ihtc = {
|
launchd.user.agents.ihtc = {
|
||||||
command = "${self.packages.${system}.ihtc}/bin/ihtc --listen 127.0.0.1:${toString cfg.port} --refrag ${toString cfg.refrag} --auto-proxy"
|
command = "${self.packages.${system}.ihtc}/bin/ihtc --listen 127.0.0.1:${toString cfg.port} --min-chunk ${toString cfg.minChunk} --max-chunk ${toString cfg.maxChunk} --delay-us ${toString cfg.delayUs} --refrag ${toString cfg.refrag} --auto-proxy"
|
||||||
+ lib.optionalString cfg.verbose " --verbose"
|
+ lib.optionalString cfg.verbose " --verbose"
|
||||||
+ lib.optionalString (cfg.patterns != [ ]) " --regex '${regex}'";
|
+ lib.optionalString (cfg.patterns != [ ]) " --regex '${regex}'"
|
||||||
|
+ lib.optionalString (cfg.extraArgs != [ ]) " ${builtins.concatStringsSep " " cfg.extraArgs}";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
RunAtLoad = true;
|
RunAtLoad = true;
|
||||||
KeepAlive = true;
|
KeepAlive = true;
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,10 @@ in
|
||||||
description = "ihtc DPI bypass proxy";
|
description = "ihtc DPI bypass proxy";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${self.packages.${system}.ihtc}/bin/ihtc --listen 127.0.0.1:${toString cfg.port} --refrag ${toString cfg.refrag}"
|
ExecStart = "${self.packages.${system}.ihtc}/bin/ihtc --listen 127.0.0.1:${toString cfg.port} --min-chunk ${toString cfg.minChunk} --max-chunk ${toString cfg.maxChunk} --delay-us ${toString cfg.delayUs} --refrag ${toString cfg.refrag}"
|
||||||
+ lib.optionalString cfg.verbose " --verbose"
|
+ lib.optionalString cfg.verbose " --verbose"
|
||||||
+ lib.optionalString (cfg.patterns != [ ]) " --regex '${regex}'";
|
+ lib.optionalString (cfg.patterns != [ ]) " --regex '${regex}'"
|
||||||
|
+ lib.optionalString (cfg.extraArgs != [ ]) " ${builtins.concatStringsSep " " cfg.extraArgs}";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,30 @@ in
|
||||||
description = "Minimum chunk count for ClientHello (0 = disabled)";
|
description = "Minimum chunk count for ClientHello (0 = disabled)";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
minChunk = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 3;
|
||||||
|
description = "Minimum bytes per fragment";
|
||||||
|
};
|
||||||
|
|
||||||
|
maxChunk = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8;
|
||||||
|
description = "Maximum bytes per fragment";
|
||||||
|
};
|
||||||
|
|
||||||
|
delayUs = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 500;
|
||||||
|
description = "Max microsecond delay between fragments (0 to disable)";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraArgs = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
description = "Extra CLI arguments passed to ihtc";
|
||||||
|
};
|
||||||
|
|
||||||
verbose = mkOption {
|
verbose = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue