mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-03 18:40:52 +08:00
feat: add Vless Encryption support
This commit is contained in:
@@ -71,6 +71,10 @@ class ServerSave extends FormRequest
|
||||
'network' => 'required|string',
|
||||
'network_settings' => 'nullable|array',
|
||||
'flow' => 'nullable|string',
|
||||
'encryption' => 'nullable|array',
|
||||
'encryption.enabled' => 'nullable|boolean',
|
||||
'encryption.encryption' => 'nullable|string',
|
||||
'encryption.decryption' => 'nullable|string',
|
||||
'tls_settings.server_name' => 'nullable|string',
|
||||
'tls_settings.allow_insecure' => 'nullable|boolean',
|
||||
'reality_settings.allow_insecure' => 'nullable|boolean',
|
||||
|
||||
@@ -203,6 +203,15 @@ class Server extends Model
|
||||
'tls' => ['type' => 'integer', 'default' => 0],
|
||||
'tls_settings' => ['type' => 'array', 'default' => null],
|
||||
'flow' => ['type' => 'string', 'default' => null],
|
||||
'encryption' => [
|
||||
'type' => 'object',
|
||||
'default' => null,
|
||||
'fields' => [
|
||||
'enabled' => ['type' => 'boolean', 'default' => false],
|
||||
'encryption' => ['type' => 'string', 'default' => null], // 客户端公钥
|
||||
'decryption' => ['type' => 'string', 'default' => null], // 服务端私钥
|
||||
]
|
||||
],
|
||||
'network' => ['type' => 'string', 'default' => null],
|
||||
'network_settings' => ['type' => 'array', 'default' => null],
|
||||
...self::REALITY_CONFIGURATION,
|
||||
|
||||
@@ -332,6 +332,10 @@ class ClashMeta extends AbstractProtocol
|
||||
'cipher' => 'auto',
|
||||
'udp' => true,
|
||||
'flow' => data_get($protocol_settings, 'flow'),
|
||||
'encryption' => match (data_get($protocol_settings, 'encryption.enabled')) {
|
||||
true => data_get($protocol_settings, 'encryption.encryption', 'none'),
|
||||
default => 'none'
|
||||
},
|
||||
'tls' => false
|
||||
];
|
||||
|
||||
|
||||
@@ -151,7 +151,10 @@ class General extends AbstractProtocol
|
||||
$config = [
|
||||
'mode' => 'multi', //grpc传输模式
|
||||
'security' => '', //传输层安全 tls/reality
|
||||
'encryption' => 'none', //加密方式
|
||||
'encryption' => match (data_get($protocol_settings, 'encryption.enabled')) {
|
||||
true => data_get($protocol_settings, 'encryption.encryption', 'none'),
|
||||
default => 'none'
|
||||
},
|
||||
'type' => data_get($server, 'protocol_settings.network'), //传输协议
|
||||
'flow' => data_get($protocol_settings, 'flow'),
|
||||
];
|
||||
|
||||
@@ -183,6 +183,7 @@ class ServerService
|
||||
...$baseConfig,
|
||||
'tls' => (int) $protocolSettings['tls'],
|
||||
'flow' => $protocolSettings['flow'],
|
||||
'decryption' => data_get($protocolSettings, 'encryption.decryption'),
|
||||
'tls_settings' => match ((int) $protocolSettings['tls']) {
|
||||
2 => $protocolSettings['reality_settings'],
|
||||
default => $protocolSettings['tls_settings'],
|
||||
|
||||
Submodule public/assets/admin updated: 9b2d136d81...260390202f
Reference in New Issue
Block a user