Go + Vue 管理台:Agent 隧道、域名反代、IP 安全、访客验证与监控大盘。 Gitea Actions CI 多架构镜像;纯 Go SQLite、无 CGO Docker 构建。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/wormhole/wormhole/internal/agent"
|
||||
"github.com/wormhole/wormhole/internal/server"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
printUsage()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
cmd := os.Args[1]
|
||||
args := os.Args[2:]
|
||||
|
||||
switch cmd {
|
||||
case "server", "serve", "s":
|
||||
server.Run(args)
|
||||
case "agent", "client", "a":
|
||||
agent.Run(args)
|
||||
case "help", "-h", "--help":
|
||||
printUsage()
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "unknown command: %s\n\n", cmd)
|
||||
printUsage()
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func printUsage() {
|
||||
fmt.Fprintf(os.Stderr, `Wormhole — 内网穿透 / 反向代理(统一二进制)
|
||||
|
||||
用法:
|
||||
wormhole server 启动服务端(配置在 Web 管理台)
|
||||
wormhole agent -server <地址> -key <verify_key> 启动客户端 Agent
|
||||
|
||||
简写:
|
||||
wormhole serve / wormhole s
|
||||
wormhole client / wormhole a
|
||||
|
||||
示例:
|
||||
wormhole server
|
||||
wormhole agent -server 127.0.0.1:8528 -key abc123
|
||||
|
||||
`)
|
||||
}
|
||||
Reference in New Issue
Block a user