mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-28 06:47:24 +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:
@@ -172,4 +172,38 @@ sh update.sh
|
||||
1. Changes to admin path require service restart to take effect
|
||||
2. Any code changes after enabling Octane require restart to take effect
|
||||
3. When PHP extension installation fails, check if PHP version is correct
|
||||
4. For database connection failures, check database configuration and permissions
|
||||
4. For database connection failures, check database configuration and permissions
|
||||
|
||||
## Enable WebSocket Real-time Sync (Optional)
|
||||
|
||||
WebSocket enables real-time synchronization of configurations and user changes to nodes.
|
||||
|
||||
### 1. Start WS Server
|
||||
|
||||
Add a WebSocket daemon process in aaPanel Supervisor:
|
||||
- Name: `Xboard-WS`
|
||||
- Run User: `www`
|
||||
- Running Directory: Site directory
|
||||
- Start Command: `php artisan xboard:ws-server start`
|
||||
- Process Count: 1
|
||||
|
||||
### 2. Configure Nginx
|
||||
|
||||
Add the WebSocket location **before** the main `location ^~ /` block in your site's Nginx configuration:
|
||||
```nginx
|
||||
location /ws/ {
|
||||
proxy_pass http://127.0.0.1:8076;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Restart Services
|
||||
|
||||
Restart the Octane and WS Server processes in Supervisor.
|
||||
|
||||
> The node will automatically detect WebSocket availability during handshake. No extra configuration is needed on the node side.
|
||||
|
||||
Reference in New Issue
Block a user