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:
@@ -44,6 +44,7 @@ export class SurgeDomainSet extends BaseWriteStrategy {
|
||||
writeSourceIpCidrs = noop;
|
||||
writeSourcePorts = noop;
|
||||
writeDestinationPorts = noop;
|
||||
writeProtocols = noop;
|
||||
writeOtherRules = noop;
|
||||
}
|
||||
|
||||
@@ -130,6 +131,10 @@ export class SurgeRuleSet extends BaseWriteStrategy {
|
||||
appendSetElementsToArray(this.result, port, i => `DEST-PORT,${i}`);
|
||||
}
|
||||
|
||||
writeProtocols(protocol: Set<string>): void {
|
||||
appendSetElementsToArray(this.result, protocol, i => `PROTOCOL,${i}`);
|
||||
}
|
||||
|
||||
writeOtherRules(rule: string[]): void {
|
||||
appendArrayInPlace(this.result, rule);
|
||||
}
|
||||
@@ -268,5 +273,6 @@ export class SurgeMitmSgmodule extends BaseWriteStrategy {
|
||||
writeSourceIpCidrs = noop;
|
||||
writeSourcePorts = noop;
|
||||
writeDestinationPorts = noop;
|
||||
writeProtocols = noop;
|
||||
writeOtherRules = noop;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user