connect-service

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command connect-service 是服务 B:建立远程连接并验证访问服务 A 的本地服务。

流程:

  1. 用 SDK 连接服务 A 创建的隧道
  2. 在本地建立端口映射
  3. 自动发起 HTTP 请求验证能否访问远端服务
  4. 持续保持连接,Ctrl+C 退出

用法:

export HW_API_KEY="your-api-key"
TUNNEL_ID="服务A打印的隧道ID" go run ./cmd/connect-service

可选环境变量:

PORT         本地映射端口/远端端口(默认 18080)
TUNNEL_ID    隧道 ID(必填)
LOCAL_IP     本地监听地址(默认 127.0.0.1)
API_BASE_URL 覆盖 SDK 默认 REST API 地址
GATEWAY_ADDR 覆盖 SDK 默认网关地址(host:port)
GATEWAY_HOST 覆盖 SDK 默认网关 SNI host
NO_VERIFY     设为 1 时跳过自动访问验证

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL