Protocol/Network rule support

This commit is contained in:
SukkaW
2025-05-03 22:54:25 +08:00
parent c3e4a1a445
commit 76f56fa0e0
6 changed files with 42 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ export class FileOutput {
protected sourceIpOrCidr = new Set<string>();
protected sourcePort = new Set<string>();
protected destPort = new Set<string>();
protected protocol = new Set<string>();
protected otherRules: string[] = [];
@@ -199,6 +200,9 @@ export class FileOutput {
case 'DEST-PORT':
this.destPort.add(value);
break;
case 'PROTOCOL':
this.protocol.add(value.toUpperCase());
break;
default:
this.otherRules.push(line);
break;
@@ -327,6 +331,9 @@ export class FileOutput {
if (this.domainWildcard.size) {
strategy.writeDomainWildcards(this.domainWildcard);
}
if (this.protocol.size) {
strategy.writeProtocols(this.protocol);
}
if (this.userAgent.size) {
strategy.writeUserAgents(this.userAgent);
}