高性能TCP-WebSocket转发服务,支持热重载和实时监控。
- 🚀 高性能转发 - TCP到WebSocket的双向数据转发
- 📊 实时监控 - 连接状态、性能指标、健康检查
- 🔄 热重载 - 配置文件变化自动重载,无需重启
- 🎯 命令调度 - 灵活的命令处理和路由系统
- 🔌 插件系统 - 支持动态加载和管理插件
- 🌐 HTTP API - RESTful API管理接口
- 📝 配置管理 - 支持YAML/JSON格式配置
- 📋 完整测试 - 高测试覆盖率,保证代码质量
# 使用 uv(推荐)
uv install
# 或使用 pip
pip install -r requirements.txtpython -m cobalt_forward init-config --output config.yaml# 生产模式
python -m cobalt_forward start --config config.yaml
# 开发模式(支持热重载)
python -m cobalt_forward dev --port 8000python -m cobalt_forward health-check项目具备完整的测试覆盖,包括:
- ✅ 主入口测试 - CLI命令和应用启动
- ✅ API层测试 - FastAPI应用和路由
- ✅ 日志系统测试 - 日志设置和管理器
- ✅ 命令调度测试 - 命令处理和调度
- ✅ 插件系统测试 - 插件管理和生命周期
- ✅ 配置监控测试 - 文件监控和热重载
- ✅ 核心服务测试 - 所有核心组件和接口
# 运行所有测试
pytest
# 带覆盖率报告
pytest --cov=cobalt_forward --cov-report=html
# 运行特定测试
pytest tests/test_main.py -v详细文档位于 doc/ 目录:
cobalt_forward/
├── application/ # 应用层
├── core/ # 核心层
├── infrastructure/ # 基础设施层
├── presentation/ # 表现层
├── plugins/ # 插件系统
└── main.py # 主入口
# 类型检查
mypy cobalt_forward
# 代码格式化
black cobalt_forward tests
isort cobalt_forward tests
# 代码质量检查
ruff cobalt_forward tests