mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 19:37:35 +08:00
feat: introduce WebSocket sync for XBoard nodes
- Implement Workerman-based `xboard:ws-server` for real-time node synchronization. - Support custom routes, outbounds, and certificate configurations via JSON. - Optimize scheduled tasks with `lazyById` to minimize memory footprint. - Enhance reactivity using Observers for `Plan`, `Server`, and `ServerRoute`. - Expand protocol support for `httpupgrade`, `h2`, and `mieru`.
This commit is contained in:
@@ -26,6 +26,8 @@ class CacheKey
|
||||
'SERVER_*_LAST_PUSH_AT', // 节点最后推送时间
|
||||
'SERVER_*_LOAD_STATUS', // 节点负载状态
|
||||
'SERVER_*_LAST_LOAD_AT', // 节点最后负载提交时间
|
||||
'SERVER_*_METRICS', // 节点指标数据
|
||||
'USER_ONLINE_CONN_*_*', // 用户在线连接数 (特定节点类型_ID)
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -57,7 +59,7 @@ class CacheKey
|
||||
private static function matchesPattern(string $key): bool
|
||||
{
|
||||
foreach (self::ALLOWED_PATTERNS as $pattern) {
|
||||
$regex = '/^' . str_replace('*', '[A-Z_]+', $pattern) . '$/';
|
||||
$regex = '/^' . str_replace('*', '[A-Za-z0-9_]+', $pattern) . '$/';
|
||||
if (preg_match($regex, $key)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user