HTTP tunnels via Cloudflare quick tunnels. Expose local ports to the internet.
Part of the Ghost in the Shell ecosystem.
brew install cloudflaredgo install github.com/rcliao/shell-tunnel/cmd/shell-tunnel@latest# Expose a local port
shell-tunnel start --port 8080
# Expose with HTTPS protocol
shell-tunnel start --port 3000 --protocol https
# List active tunnels
shell-tunnel list
# Stop a tunnel
shell-tunnel stop --port 8080import tunnel "github.com/rcliao/shell-tunnel"
mgr := tunnel.NewManager(tunnel.Config{
Enabled: true,
CloudflaredBin: "cloudflared",
MaxTunnels: 5,
DefaultProtocol: "http",
})
// Start a tunnel
result := tunnel.Execute(ctx, mgr, tunnel.Directive{Action: "start", Port: "8080"})
// List active tunnels
result = tunnel.Execute(ctx, mgr, tunnel.Directive{Action: "list"})
// Stop all on shutdown
mgr.StopAll()[tunnel port="8080"]
[tunnel action="proxy.php?url=https%3A%2F%2Fgithub.com%2Fstop" port="8080"]
[tunnel action="proxy.php?url=https%3A%2F%2Fgithub.com%2Flist"]
Attributes:
port— local port to expose (required for start/stop)action—start(default),stop, orlistprotocol—http(default) orhttps
make build # Build binary
make test # Run tests
make vet # Run go vetMIT