mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Protocol/Network rule support
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user