Skip to content

Commit bbd7288

Browse files
committed
Added option to fragment all domains
1 parent 0f72d82 commit bbd7288

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ Please report any problems and malfunctions to us on [the Issues page](https://g
105105
## Supported arguments / Поддерживаемые аргументы командной строки
106106
```
107107
usage: nodpi [-h] [--host HOST] [--port PORT] [--blacklist BLACKLIST]
108-
[--log_access LOG_ACCESS] [--log_error LOG_ERROR] [-q] [-v]
109-
[--install | --uninstall]
108+
[--log_access LOG_ACCESS] [--log_error LOG_ERROR] [--no_blacklist]
109+
[-q] [-v] [--install | --uninstall]
110110
111111
options:
112112
-h, --help show this help message and exit
@@ -118,6 +118,7 @@ options:
118118
Path to the access control log
119119
--log_error LOG_ERROR
120120
Path to log file for errors
121+
--no_blacklist Use fragmentation for all domains
121122
-q, --quiet Remove UI output
122123
-v, --verbose Show more info (only for devs)
123124
--install Add proxy to Windows autostart (only for EXE)

src/main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ def __init__(self, src_ip, dst_domain, method):
3030

3131
class ProxyServer:
3232

33-
def __init__(self, host, port, blacklist, log_access, log_err, quiet, verbose):
33+
def __init__(self, host, port, blacklist, log_access, log_err, no_blacklist, quiet, verbose):
3434

3535
self.host = host
3636
self.port = port
3737
self.blacklist = blacklist
3838
self.log_access_file = log_access
3939
self.log_err_file = log_err
40+
self.no_blacklist = no_blacklist
4041
self.quiet = quiet
4142
self.verbose = verbose
4243

@@ -387,7 +388,7 @@ async def fragment_data(self, reader, writer):
387388
self.print(f"\033[93m[NON-CRITICAL]:\033[97m {e}\033[0m")
388389
return
389390

390-
if all(site not in data for site in self.blocked):
391+
if not self.no_blacklist and all(site not in data for site in self.blocked):
391392
self.allowed_connections += 1
392393
writer.write(head + data)
393394
await writer.drain()
@@ -447,6 +448,9 @@ def parse_args():
447448
parser.add_argument(
448449
"--log_error", required=False, help="Path to log file for errors"
449450
)
451+
parser.add_argument(
452+
"--no_blacklist", action="store_true", help="Use fragmentation for all domains"
453+
)
450454
parser.add_argument(
451455
"-q", "--quiet", action="store_true", help="Remove UI output"
452456
)
@@ -537,6 +541,7 @@ async def run(cls):
537541
args.blacklist,
538542
args.log_access,
539543
args.log_error,
544+
args.no_blacklist,
540545
args.quiet,
541546
args.verbose,
542547
)

0 commit comments

Comments
 (0)