Files
NebulaShell/store/@{FutureOSS}/http-tcp
qwen.ai[bot] 97ced1b5e6 Title: Implement minimal core framework with PL injection and update build config
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.
2026-04-25 10:47:26 +00:00
..
2026-04-17 23:15:15 +08:00

http-tcp HTTP TCP 服务

提供基于 TCP 的 HTTP 协议实现。

功能

  • 原始 TCP HTTP 服务器
  • 路由匹配
  • 中间件链(日志/CORS
  • 连接管理
  • 事件发布(通过 plugin-bridge

使用

tcp = plugin_mgr.get("http-tcp")

# 注册路由
tcp.router.get("/api/status", lambda req: {
    "status": 200,
    "headers": {"Content-Type": "application/json"},
    "body": '{"status": "ok"}'
})

# 获取客户端
clients = tcp.server.get_clients()

事件

bridge = plugin_mgr.get("plugin-bridge")
bus = bridge.event_bus

bus.on("tcp.connect", lambda e: print(f"连接: {e.client.id}"))
bus.on("tcp.http.request", lambda e: print(f"请求: {e.context['request']['path']}"))
bus.on("tcp.disconnect", lambda e: print(f"断开: {e.client.id}"))

配置

{
  "config": {
    "args": {
      "host": "0.0.0.0",
      "port": 8082
    }
  }
}