update: v2rayn

This commit is contained in:
tokumeikoi 2022-12-16 15:59:37 +08:00
parent 48056cf03f
commit 9c47d4d09a

View File

@ -3,6 +3,8 @@
namespace App\Http\Controllers\Client\Protocols; namespace App\Http\Controllers\Client\Protocols;
use App\Utils\Helper;
class V2rayN class V2rayN
{ {
public $flag = 'v2rayn'; public $flag = 'v2rayn';
@ -37,6 +39,16 @@ class V2rayN
public static function buildShadowsocks($password, $server) public static function buildShadowsocks($password, $server)
{ {
if ($server['cipher'] === '2022-blake3-aes-128-gcm') {
$serverKey = Helper::getShadowsocksServerKey($server['created_at'], 16);
$userKey = Helper::uuidToBase64($password, 16);
$password = "{$serverKey}:{$userKey}";
}
if ($server['cipher'] === '2022-blake3-aes-256-gcm') {
$serverKey = Helper::getShadowsocksServerKey($server['created_at'], 32);
$userKey = Helper::uuidToBase64($password, 32);
$password = "{$serverKey}:{$userKey}";
}
$name = rawurlencode($server['name']); $name = rawurlencode($server['name']);
$str = str_replace( $str = str_replace(
['+', '/', '='], ['+', '/', '='],