Key features implemented: - New RELEASE_v1.1.0.md with comprehensive release notes for security upgrades and new features - New firewall.py plugin implementing dynamic IP filtering, port management, and attack detection - New frp_proxy.py plugin for FRP-based internal network tunneling and proxy services - New ftp_server.py plugin providing secure file transfer with user management and access control - New multi_lang_deploy.py orchestrator supporting automated detection and deployment of Python/Node.js/Go/Java/PHP projects - New ops_toolbox.py with backup/recovery, health checks, and resource quota management - New security_gateway.py with API rate limiting, JWT authentication, audit logging, and circuit breaker protection - New HTML5/CSS3/JS-based webui replacing PHP templates with modern responsive design and real-time metrics - New manifest.json files for all plugins adding configuration schemas and dependency declarations - Updated .gitignore with refined ignore patterns for development environments - Modified core plugin manifests to include internationalization dependencies and enhanced configurations - Removed legacy PHP template files from webui frontend views - Enhanced plugin bridge, storage, signature verification with multilingual support and security improvements
ws-api WebSocket API
提供 WebSocket 实时双向通信服务。
功能
- WebSocket 服务器
- 路由匹配
- 中间件链(认证/日志)
- 广播消息
- 连接/断开/消息事件
- 与 HTTP 插件集成
使用
ws = plugin_mgr.get("ws-api")
# 注册消息路由
ws.router.on_message("/chat", lambda client, msg: client.send({"echo": msg}))
# 广播
ws.server.broadcast({"type": "announcement", "data": "服务器维护通知"})
# 获取客户端列表
clients = ws.server.get_clients()
事件
# 通过 plugin-bridge 订阅 WS 事件
bridge = plugin_mgr.get("plugin-bridge")
bridge.event_bus.on("ws.connect", lambda event: print(f"新连接: {event.client.path}"))
bridge.event_bus.on("ws.message", lambda event: print(f"消息: {event.message}"))
bridge.event_bus.on("ws.disconnect", lambda event: print(f"断开: {event.client.id}"))
配置
{
"config": {
"args": {
"host": "0.0.0.0",
"port": 8081
}
}
}