Key features implemented: - Updated package metadata and dependencies in PKG-INFO, setup files - Added main.py entry point for backward compatibility with README launch method - Enhanced CLI with config options, system info command, and proper signal handling - Implemented minimal PluginManager loading only plugin-loader core plugin - Refactored PluginLoader to follow minimal core design, removed sandbox/isolation complexity - Updated auto-dependency plugin with safer PL injection mechanism and disabled pl_injection - Removed legacy plugin files (firewall, frp_proxy, ftp_server, multi_lang_deploy, ops_toolbox, security_gateway) as functionality moved to core plugin system - Improved gitignore with comprehensive ignore patterns The changes implement a minimal core framework design where only the plugin-loader is directly loaded by the core, with all other plugins managed through the PL injection mechanism, significantly simplifying the architecture.
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
}
}
}