Skip to content

Commit

Permalink
fix: correct know issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xboard committed Jan 17, 2025
1 parent ef8cc8b commit 0bbdf7a
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions app/Protocols/SingBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,21 @@ protected function buildVless($password, $server)
'fingerprint' => Helper::getRandFingerprint()
]
];
if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) {
$tlsConfig['server_name'] = $serverName;
}
if ($protocol_settings['tls'] == 2) {
$tlsConfig['reality'] = [
'enabled' => true,
'public_key' => data_get($protocol_settings, 'reality_settings.public_key'),
'short_id' => data_get($protocol_settings, 'reality_settings.short_id')
];

switch ($protocol_settings['tls']) {
case 1:
if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) {
$tlsConfig['server_name'] = $serverName;
}
break;
case 2:
$tlsConfig['server_name'] = data_get($protocol_settings, 'reality_settings.server_name');
$tlsConfig['reality'] = [
'enabled' => true,
'public_key' => data_get($protocol_settings, 'reality_settings.public_key'),
'short_id' => data_get($protocol_settings, 'reality_settings.short_id')
];
break;
}

$array['tls'] = $tlsConfig;
Expand Down

0 comments on commit 0bbdf7a

Please sign in to comment.