Skip to content

feat(v2): Port Forwarding — Console 本地监听与连接管理 #11

Description

@monster-echo

背景

#9 #10 已经能让字节流跑通。Console 端需要起本地 listener 把流量导入 tunnel。

范围

In

  • Console 本地启动 TCP listener(仅 127.0.0.1,禁止对外暴露)
  • 接受连接 → 申请 stream id → 发 TunnelOpenFrame
  • TCP 读到的字节 → TunnelDataFrame
  • 收到 TunnelDataFrame → 写 TCP
  • 收到 TunnelCloseFrame / TunnelErrorFrame → 关 TCP 并在 UI 显示
  • UI:session 详情页配置端口转发规则(local port → remote host:port),启停按钮
  • Mobile / Harmony 不要求(手机不适合做端口转发入口)

Out

验收

  • curl http://127.0.0.1:<local> 能打到 Worker 机器的 HTTP 服务
  • 关闭 Console 后 listener 立即关闭,没有残留进程
  • 多个 session 的 listener 互不冲突

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions