跳到主要内容

inlets

  • inlets/inlets - L7 HTTP/HTTPS 通道 - MIT
    • 反向通道 客户端和服务端 - 类似 ngrok, argo tunnel
    • 一个进程一个 tunnel
    • 自动重连
    • 支持 ws 和 wss 通讯
    • 支持 http, https, ws 通道
    • 默认开启 CORS - --disable-transport-wrapping
    • 注意 ⚠️ 不支持 gRPC
  • inlets-pro - L4 通道 - 商业授权
    • 支持 TCP 自动 TLS 加密
    • ⚠️ 个人 2 通道 180/年,商业 5 通道 1860/年 额外通道 20/月
      • 个人认为不值得 - 如果使用较多建议自行实现
  • inlets/inletsctl
    • 自动安装配置
# macOS
brew install inlets

# 服务端
# http://localhost:8000
# -t 可设置 Token
inlets server

# 客户端
python -m SimpleHTTPServer 8123
# 启动后访问 localhost:8000 即可
# remote 使用 ws 协议
inlets client --remote 127.0.0.1:8000 --upstream http://127.0.0.1:8123

kubernetes operator

笔记

  • 使用 websocket 进行 tunnel
  • HTTP 头
    • x-inlets-id - 客户端 uuid
    • x-inlets-upstream - 需要客户端请求的上游
  • 没有处理 http2
    • pro 有
    • 因此无法使用 grpc2
    • 检测 http2 支持 curl -sI https://curl.haxx.se -o/dev/null -w '%{http_version}\n'
  • 路由逻辑在 pkg/router
  • server
    • / - 前端代理
    • /tunnel - client 过来的通道