Allow to use fbegin without fend

This commit is contained in:
Vadim Vetrov
2024-12-18 22:00:49 +03:00
parent 25199288e8
commit 062200d9ea
2 changed files with 4 additions and 5 deletions

View File

@@ -264,7 +264,7 @@ Available flags:
- `--packet-mark=<mark>` Use this option if youtubeUnblock conflicts with other systems rely on packet mark. Note that you may want to change accept rule for iptables to follow the mark. - `--packet-mark=<mark>` Use this option if youtubeUnblock conflicts with other systems rely on packet mark. Note that you may want to change accept rule for iptables to follow the mark.
- `--fbegin` and `--fend` flags: youtubeUnblock supports multiple sets of strategies for specific filters. You may want to initiate a new set after the default one, like: `--sni-domains=googlevideo.com --faking-strategy=md5sum --fbegin --sni-domains=youtube.com --faking-strategy=tcp_check --fend --fbegin --sni-domains=l.google.com --faking-strategy=pastseq --fend`. Note, that the priority of these sets goes backwards: last is first, default (one that does not start with --fbegin) is last. If you start the new section, the default settings are implemented just like youtubeUnblock without any parameters. Note that the config above is just an example and won't work for you. - `--fbegin` and `--fend` flags: youtubeUnblock supports multiple sets of strategies for specific filters. You may want to initiate a new set after the default one, like: `--sni-domains=googlevideo.com --faking-strategy=md5sum --fbegin --sni-domains=youtube.com --faking-strategy=tcp_check --fbegin --sni-domains=l.google.com --faking-strategy=pastseq`. Note, that the priority of these sets goes backwards: last is first, default (one that does not start with --fbegin) is last. If you start the new section, the default settings are implemented just like youtubeUnblock without any parameters. Note that the config above is just an example and won't work for you.
## Troubleshooting ## Troubleshooting

7
args.c
View File

@@ -471,10 +471,8 @@ int yparse_args(int argc, char *argv[]) {
} }
rep_config.connbytes_limit = num; rep_config.connbytes_limit = num;
break; break;
case OPT_START_SECTION: case OPT_START_SECTION:
if (section_iter != SECT_ITER_DEFAULT && section_iter != SECT_ITER_OUTSIDE) {
goto invalid_opt;
struct section_config_t *nsect; struct section_config_t *nsect;
ret = init_section_config(&nsect, rep_config.last_section); ret = init_section_config(&nsect, rep_config.last_section);
if (ret < 0) { if (ret < 0) {
@@ -487,6 +485,7 @@ int yparse_args(int argc, char *argv[]) {
section_iter = SECT_ITER_INSIDE; section_iter = SECT_ITER_INSIDE;
break; break;
}
case OPT_END_SECTION: case OPT_END_SECTION:
if (section_iter != SECT_ITER_INSIDE) if (section_iter != SECT_ITER_INSIDE)
goto invalid_opt; goto invalid_opt;