mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
feat: Refactor uTLS & Multiplex Support, Node Status Push Optimization
- Server/ServerSave/Server.php: Unified utls and multiplex schema, validation, and defaults for vmess/vless/trojan/mieru protocols, enabling more flexible protocol configuration. - Protocols (SingBox/ClashMeta/Shadowrocket/Stash/General): All protocol generators now support utls (client-fingerprint/fp) and multiplex options. Removed getRandFingerprint, replaced with getTlsFingerprint supporting random/custom fingerprints. - Helper.php: Refactored TLS fingerprint utility to support object/string/random input. - ServerService: Abstracted updateMetrics method to unify HTTP/WS node status caching logic. - NodeWebSocketServer: Improved node connection, status push, and full sync logic; adjusted log levels; clarified push logic. - ServerController: Reused ServerService for node metrics handling, reducing code duplication. - Docs: Improved aapanel installation docs, added fix for empty admin dashboard.
This commit is contained in:
+13
-1
@@ -188,8 +188,20 @@ class Helper
|
||||
public static function getIpByDomainName($domain) {
|
||||
return gethostbynamel($domain) ?: [];
|
||||
}
|
||||
|
||||
public static function getTlsFingerprint($utls = null)
|
||||
{
|
||||
|
||||
if (is_array($utls) || is_object($utls)) {
|
||||
if (!data_get($utls, 'enabled')) {
|
||||
return null;
|
||||
}
|
||||
$fingerprint = data_get($utls, 'fingerprint', 'chrome');
|
||||
if ($fingerprint !== 'random') {
|
||||
return $fingerprint;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getRandFingerprint() {
|
||||
$fingerprints = ['chrome', 'firefox', 'safari', 'ios', 'edge', 'qq'];
|
||||
return Arr::random($fingerprints);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user