Files
NebulaShell/store/@{FutureOSS}/http-api
qwen.ai[bot] f8853ca45e Title: Upgrade to FutureOSS v1.1.0 with enterprise-grade security and deployment features
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
2026-04-25 00:01:05 +00:00
..
2026-04-17 23:15:15 +08:00
2026-04-17 23:15:15 +08:00

http-api HTTP API 服务

提供 HTTP RESTful API 服务,支持路由、中间件等功能。

功能

  • HTTP 服务器GET/POST/PUT/DELETE
  • 路由匹配(支持参数路由 :id
  • 中间件链CORS/日志/限流)
  • 分散式布局(每个文件 < 200 行)

路由使用

# 在插件中获取 router
http_plugin = plugin_mgr.get("http-api")
router = http_plugin.router

# 添加路由
router.get("/health", lambda req: Response(status=200, body='{"status": "ok"}'))
router.get("/api/users", handle_users)
router.post("/api/users", handle_create_user)
router.get("/api/users/:id", handle_user_by_id)

中间件

middleware = http_plugin.middleware

# 添加自定义中间件
class MyMiddleware(Middleware):
    def process(self, ctx, next_fn):
        # 前置处理
        resp = next_fn()  # 继续执行
        # 后置处理
        return resp

middleware.add(MyMiddleware())

配置

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