Browse Source

feat: add ss 2022 method

Cat 3 years ago
parent
commit
ad152c9793
2 changed files with 5 additions and 15 deletions
  1. 5 2
      src/Services/Config.php
  2. 0 13
      src/Utils/AppURI.php

+ 5 - 2
src/Services/Config.php

@@ -227,10 +227,13 @@ final class Config
                     'chacha20-ietf',
                     'aes-128-gcm',
                     'aes-192-gcm',
-                    'none',
-                    'aes-256-gcm',
+                    'aes-256-gcm',         
                     'chacha20-ietf-poly1305',
                     'xchacha20-ietf-poly1305',
+                    'none',
+                    '2022-blake3-aes-128-gcm',
+                    '2022-blake3-aes-256-gcm',
+                    '2022-blake3-chacha20-poly1305',
                 ];
         }
     }

+ 0 - 13
src/Utils/AppURI.php

@@ -196,12 +196,6 @@ final class AppURI
         $return = null;
         switch ($item['type']) {
             case 'ss':
-                // ;shadowsocks=example.com:80, method=chacha20, password=pwd, obfs=http, obfs-host=bing.com, obfs-uri=/resource/file, fast-open=false, udp-relay=false, server_check_url=http://www.apple.com/generate_204, tag=ss-01
-                // ;shadowsocks=example.com:80, method=chacha20, password=pwd, obfs=http, obfs-host=bing.com, obfs-uri=/resource/file, fast-open=false, udp-relay=false, tag=ss-02
-                // ;shadowsocks=example.com:443, method=chacha20, password=pwd, obfs=tls, obfs-host=bing.com, fast-open=false, udp-relay=false, tag=ss-03
-                // ;shadowsocks=example.com:80, method=aes-128-gcm, password=pwd, obfs=ws, fast-open=false, udp-relay=false, tag=ss-ws-01
-                // ;shadowsocks=example.com:80, method=aes-128-gcm, password=pwd, obfs=ws, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=ss-ws-02
-                // ;shadowsocks=example.com:443, method=aes-128-gcm, password=pwd, obfs=wss, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=ss-ws-tls
                 $return = 'shadowsocks=' . $item['address'] . ':' . $item['port'] . ', method=' . $item['method'] . ', password=' . $item['passwd'];
                 switch ($item['obfs']) {
                     case 'simple_obfs_http':
@@ -221,7 +215,6 @@ final class AppURI
                 $return .= ', tag=' . $item['remark'];
                 break;
             case 'ssr':
-                // ;shadowsocks=example.com:443, method=chacha20, password=pwd, ssr-protocol=auth_chain_b, ssr-protocol-param=def, obfs=tls1.2_ticket_fastauth, obfs-host=bing.com, tag=ssr
                 $return = 'shadowsocks=' . $item['address'] . ':' . $item['port'] . ', method=' . $item['method'] . ', password=' . $item['passwd'];
                 $return .= ', ssr-protocol=' . $item['protocol'];
                 $return .= ', ssr-protocol-param=' . $item['protocol_param'];
@@ -230,11 +223,6 @@ final class AppURI
                 $return .= ', tag=' . $item['remark'];
                 break;
             case 'vmess':
-                // ;vmess=example.com:80, method=none, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, fast-open=false, udp-relay=false, tag=vmess-01
-                // ;vmess=example.com:80, method=aes-128-gcm, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, fast-open=false, udp-relay=false, tag=vmess-02
-                // ;vmess=example.com:443, method=none, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs=over-tls, fast-open=false, udp-relay=false, tag=vmess-tls
-                // ;vmess=example.com:80, method=chacha20-poly1305, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs=ws, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=vmess-ws
-                // ;vmess=example.com:443, method=chacha20-poly1305, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs=wss, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=vmess-ws-tls
                 if (! \in_array($item['net'], ['ws', 'tcp'])) {
                     break;
                 }
@@ -251,7 +239,6 @@ final class AppURI
                 $return .= ', tag=' . $item['remark'];
                 break;
             case 'trojan':
-                // ;trojan=example.com:443, password=pwd, over-tls=true, tls-verification=true, fast-open=false, udp-relay=false, tag=trojan-tls-01
                 $return = 'trojan=' . $item['address'] . ':' . $item['port'] . ', password=' . $item['passwd'] . ', tls-host=' . $item['host'];
                 $return .= ', over-tls=true, tls-verification=true';
                 $return .= ', tag=' . $item['remark'];