From 527c25500564e64cd67bba03e37174a60fe6045b Mon Sep 17 00:00:00 2001 From: lhie1 Date: Wed, 30 Jun 2021 21:33:52 +0800 Subject: [PATCH] Block QUIC --- Clash/Rule.yaml | 7 ++++++- Surge/Surge 3/Module/Block_QUIC.sgmodule | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Surge/Surge 3/Module/Block_QUIC.sgmodule diff --git a/Clash/Rule.yaml b/Clash/Rule.yaml index e1c722f..8d701cc 100644 --- a/Clash/Rule.yaml +++ b/Clash/Rule.yaml @@ -67,7 +67,6 @@ script: code: | def main(ctx, metadata): - 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] ruleset_action = {"Reject": "AdBlock", "Special": "DIRECT", "Netflix": "Netflix", @@ -121,6 +120,12 @@ script: } port = int(metadata["dst_port"]) + if (metadata["network"] == "UDP": + if port == 443: + ctx.log('[Script] matched QUIC traffic use reject') + return "REJECT" + + 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" diff --git a/Surge/Surge 3/Module/Block_QUIC.sgmodule b/Surge/Surge 3/Module/Block_QUIC.sgmodule new file mode 100644 index 0000000..5627b59 --- /dev/null +++ b/Surge/Surge 3/Module/Block_QUIC.sgmodule @@ -0,0 +1,5 @@ +#!name=Block QUIC Protocol +#!desc=Forced fallback HTTP2/HTTP1.1 + +[Rule] +AND,((PROTOCOL,UDP),(DEST-PORT,443)),REJECT-NO-DROP \ No newline at end of file