Browse Source

[Uim] sing-box UoT & utls (#2450)

* Update appprofile.example.php

* Update SingBox.php
77-QiQi 1 year ago
parent
commit
2c7a1b3632
2 changed files with 9 additions and 1 deletions
  1. 1 0
      config/appprofile.example.php
  2. 8 1
      src/Services/Subscribe/SingBox.php

+ 1 - 0
config/appprofile.example.php

@@ -97,6 +97,7 @@ $_ENV['SingBox_Config'] = [
             ],
             'auto_route' => true,
             'strict_route' => true,
+            'stack' => 'mixed',
             'sniff' => true,
             'sniff_override_destination' => true,
             'domain_strategy' => 'prefer_ipv4',

+ 8 - 1
src/Services/Subscribe/SingBox.php

@@ -92,6 +92,7 @@ final class SingBox extends Base
                     $path = $node_custom_config['header']['request']['path'][0] ?? $node_custom_config['path'] ?? '';
                     $headers = $node_custom_config['header']['request']['headers'] ?? [];
                     $service_name = $node_custom_config['servicename'] ?? '';
+                    $utls = $node_custom_config['utls'] ?? false;
 
                     $node = [
                         'type' => 'vmess',
@@ -104,8 +105,14 @@ final class SingBox extends Base
                         'tls' => [
                             'enabled' => true,
                             'server_name' => $host,
+                            'utls' => [
+                                'enabled' => $utls,
+                                'fingerprint' => 'chrome',
+                            ],
                         ],
-                        'packet_encoding' => 'packetaddr',
+                        'packet_encoding' => 'xudp',
+                        'global_padding' => true,
+                        'authenticated_length' => true,
                         'transport' => [
                             'type' => $transport,
                             'path' => $path,