mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: fix singbox & clash processPath, more TODO
This commit is contained in:
@@ -30,8 +30,7 @@ const PROCESSOR: Record<string, ((raw: string, type: string, value: string) => s
|
|||||||
'SRC-IP-CIDR': identity,
|
'SRC-IP-CIDR': identity,
|
||||||
'SRC-PORT': identity,
|
'SRC-PORT': identity,
|
||||||
'DST-PORT': identity,
|
'DST-PORT': identity,
|
||||||
'PROCESS-NAME': identity,
|
'PROCESS-NAME': (_raw, _type, value) => ((value.includes('/') || value.includes('\\')) ? `PROCESS-PATH,${value}` : `PROCESS-NAME,${value}`),
|
||||||
'PROCESS-PATH': identity,
|
|
||||||
'DEST-PORT': (_raw, _type, value) => `DST-PORT,${value}`,
|
'DEST-PORT': (_raw, _type, value) => `DST-PORT,${value}`,
|
||||||
'IN-PORT': (_raw, _type, value) => `SRC-PORT,${value}`,
|
'IN-PORT': (_raw, _type, value) => `SRC-PORT,${value}`,
|
||||||
'URL-REGEX': unsupported,
|
'URL-REGEX': unsupported,
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const sortTypeOrder: Record<string | typeof defaultSortTypeOrder, number> = {
|
|||||||
'URL-REGEX': 100,
|
'URL-REGEX': 100,
|
||||||
AND: 300,
|
AND: 300,
|
||||||
OR: 300,
|
OR: 300,
|
||||||
|
GEOIP: 400,
|
||||||
'IP-CIDR': 400,
|
'IP-CIDR': 400,
|
||||||
'IP-CIDR6': 400
|
'IP-CIDR6': 400
|
||||||
};
|
};
|
||||||
@@ -43,6 +44,14 @@ abstract class RuleOutput {
|
|||||||
protected ipcidrNoResolve = new Set<string>();
|
protected ipcidrNoResolve = new Set<string>();
|
||||||
protected ipcidr6 = new Set<string>();
|
protected ipcidr6 = new Set<string>();
|
||||||
protected ipcidr6NoResolve = new Set<string>();
|
protected ipcidr6NoResolve = new Set<string>();
|
||||||
|
// TODO: add sourceIpcidr
|
||||||
|
// TODO: add sourcePort
|
||||||
|
// TODO: add port
|
||||||
|
// TODO: processName
|
||||||
|
// TODO: processPath
|
||||||
|
// TODO: userAgent
|
||||||
|
// TODO: urlRegex
|
||||||
|
|
||||||
protected otherRules: Array<[raw: string, orderWeight: number]> = [];
|
protected otherRules: Array<[raw: string, orderWeight: number]> = [];
|
||||||
protected abstract type: 'domainset' | 'non_ip' | 'ip';
|
protected abstract type: 'domainset' | 'non_ip' | 'ip';
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ const PROCESSOR: Record<string, ((raw: string, type: string, value: string) => [
|
|||||||
'SRC-IP-CIDR': (_1, _2, value) => ['source_ip_cidr', value.endsWith(',no-resolve') ? value.slice(0, -11) : value],
|
'SRC-IP-CIDR': (_1, _2, value) => ['source_ip_cidr', value.endsWith(',no-resolve') ? value.slice(0, -11) : value],
|
||||||
'SRC-PORT': (_1, _2, value) => toNumberTuple('source_port', value),
|
'SRC-PORT': (_1, _2, value) => toNumberTuple('source_port', value),
|
||||||
'DST-PORT': (_1, _2, value) => toNumberTuple('port', value),
|
'DST-PORT': (_1, _2, value) => toNumberTuple('port', value),
|
||||||
'PROCESS-NAME': (_1, _2, value) => ['process_name', value],
|
'PROCESS-NAME': (_1, _2, value) => ((value.includes('/') || value.includes('\\')) ? ['process_path', value] : ['process_name', value]),
|
||||||
'PROCESS-PATH': (_1, _2, value) => ['process_path', value],
|
// 'PROCESS-PATH': (_1, _2, value) => ['process_path', value],
|
||||||
'DEST-PORT': (_1, _2, value) => toNumberTuple('port', value),
|
'DEST-PORT': (_1, _2, value) => toNumberTuple('port', value),
|
||||||
'IN-PORT': (_1, _2, value) => toNumberTuple('source_port', value),
|
'IN-PORT': (_1, _2, value) => toNumberTuple('source_port', value),
|
||||||
'URL-REGEX': unsupported,
|
'URL-REGEX': unsupported,
|
||||||
|
|||||||
Reference in New Issue
Block a user