Update
This commit is contained in:
@@ -117,10 +117,11 @@ script:
|
||||
"Domestic": "Domestic",
|
||||
"Domestic IPs": "Domestic",
|
||||
"LAN": "DIRECT"
|
||||
}
|
||||
}
|
||||
|
||||
port = int(metadata["dst_port"])
|
||||
|
||||
if (metadata["network"] == "UDP":
|
||||
if metadata["network"] == "UDP":
|
||||
if port == 443:
|
||||
ctx.log('[Script] matched QUIC traffic use reject')
|
||||
return "REJECT"
|
||||
@@ -128,22 +129,22 @@ script:
|
||||
port_list = [21, 22, 23, 53, 80, 123, 143, 194, 443, 465, 587, 853, 993, 995, 998, 2052, 2053, 2082, 2083, 2086, 2095, 2096, 5222, 5228, 5229, 5230, 8080, 8443, 8880, 8888, 8889]
|
||||
if port not in port_list:
|
||||
return "DIRECT"
|
||||
ctx.log('[Script] not common port use direct')
|
||||
|
||||
for rule_name in ctx.rule_providers.keys():
|
||||
if ctx.rule_providers[rule_name].match(metadata):
|
||||
return ruleset_action[rule_name]
|
||||
|
||||
ip = metadata["dst_ip"] or ctx.resolve_ip(metadata["host"])
|
||||
|
||||
if ip == "":
|
||||
return "DIRECT"
|
||||
|
||||
code = ctx.geoip(ip)
|
||||
|
||||
if code == "CN":
|
||||
return "Domestic"
|
||||
|
||||
ctx.log('[Script] Geoip CN')
|
||||
return "Others"
|
||||
ctx.log('[Script] FINAL')
|
||||
|
||||
rule-providers:
|
||||
Reject:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!name=Proxy for Common Port Only
|
||||
#!desc=对非常用端口使用直连策略
|
||||
#!desc=Not common port use direct
|
||||
|
||||
[Rule]
|
||||
AND,((NOT,((DEST-PORT,21))), (NOT,((DEST-PORT,22))), (NOT,((DEST-PORT,23))), (NOT,((DEST-PORT,53))), (NOT,((DEST-PORT,80))), (NOT,((DEST-PORT,123))), (NOT,((DEST-PORT,194))), (NOT,((DEST-PORT,443))), (NOT,((DEST-PORT,465))), (NOT,((DEST-PORT,587))), (NOT,((DEST-PORT,853))), (NOT,((DEST-PORT,993))), (NOT,((DEST-PORT,995))), (NOT,((DEST-PORT,998))), (NOT,((DEST-PORT,2052))), (NOT,((DEST-PORT,2053))), (NOT,((DEST-PORT,2082))), (NOT,((DEST-PORT,2083))), (NOT,((DEST-PORT,2086))), (NOT,((DEST-PORT,2095))), (NOT,((DEST-PORT,2096))), (NOT,((DEST-PORT,5222))), (NOT,((DEST-PORT,5228))), (NOT,((DEST-PORT,5229))), (NOT,((DEST-PORT,5230))), (NOT,((DEST-PORT,8080))), (NOT,((DEST-PORT,8443))), (NOT,((DEST-PORT,8880))), (NOT,((DEST-PORT,8888))), (NOT,((DEST-PORT,8889)))),DIRECT
|
||||
Reference in New Issue
Block a user