Help us shape the future of Go! Take the 2026 Go Developer Survey

expose

module
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0

README ΒΆ

Expose – Pure Go Localhost Tunneling CLI

Expose Social Preview

Downloads Documentation Tests Go Report Card

Turn your localhost into a public shareable URL in one command β€” zero config, zero signups, and a single <10MB binary.
The lightweight, open-source Go alternative to ngrok for webhook testing, mobile previews, and remote debugging.

Install via Homebrew:

brew install kernelshard/tap/expose

Tunnel your local server (e.g. port 3000):

expose tunnel 3000

πŸ’‘ What is this for?

When you run an app on http://localhost:3000, only your laptop can access it. Expose creates a temporary public HTTPS URL that connects directly to your local server:

  • πŸͺ Webhook Testing: Give Stripe, GitHub, or Twilio a live HTTPS URL to test webhook callbacks locally.
  • πŸ“± Mobile & Device Testing: Open your local website on a physical smartphone or tablet over 4G/5G.
  • πŸ‘₯ Instant Previews: Send a live demo link to a friend or client without deploying to cloud servers.
  • 🏠 Private Self-Hosting: Route traffic through your own private VPS instead of commercial SaaS relays.

πŸ†š Why Expose?

Feature πŸš€ Expose ngrok Cloudflare Tunnel LocalTunnel (Node)
Zero Signup Required βœ… Instant ❌ Mandatory account ❌ Mandatory account βœ… Instant
Single Static Binary βœ… (<10MB) βœ… (~30MB) βœ… (~50MB) ❌ (requires Node.js)
Open Source βœ… Apache 2.0 ❌ Proprietary βœ… Apache 2.0 βœ… MIT
Self-Hostable Relay βœ… expose server ❌ SaaS only ❌ Cloudflare network ⚠️ Legacy Node server
Language & Runtime Pure Go (zero CGO) Go / C Go daemon Node.js (V8 heap)
Free Custom Domains 🟑 Partial (Self-Hosted) πŸ’² Paid plan βœ… Cloudflare DNS ❌ Not supported
Memorable Subdomains βœ… Auto-assigned (swift-falcon-4821) ❌ Random hex (free tier) ❌ Random hex ⚠️ Limited words

⚑ Quick Examples

# Tunnel a local development server (defaults to port 3000)
expose tunnel 3000

# Tunnel via Cloudflare Quick Tunnels
expose tunnel -P cloudflare -p 8080

# Connect to your self-hosted relay (auto-assigns memorable subdomain: swift-falcon-4821)
expose tunnel 3000 --server=tunnel.mysite.com:7890

πŸ“¦ Installation Options

brew install kernelshard/tap/expose
2. One-Line Shell Installer
curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh

Pin a specific version or install to a custom path:

# Pin version
VERSION=v0.5.4 curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh

# Custom directory
BINDIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh
3. Pre-built Binaries

Download the latest pre-compiled binary for your architecture (macOS, Linux, Windows) from the Releases Page.

4. Via Go Install (Go 1.22+)
go install github.com/kernelshard/expose/cmd/expose@latest
5. From Source
git clone https://github.com/kernelshard/expose.git
cd expose
go build -o expose ./cmd/expose
./expose --version

🏠 Self-Hosted Relay Server

Need complete privacy and zero third-party relay dependence? Run your own tunnel gateway on any $5 VPS with a single command:

# Start your private relay server
expose server --domain=tunnel.mysite.com --control-port=7890 --public-port=8080

Connect your client to your VPS (supports custom subdomains):

expose tunnel 3000 --server=tunnel.mysite.com:7890 --subdomain=my-app

βš™οΈ Project Configuration (.expose.yml)

Save defaults per project so you can just type expose tunnel:

# Create .expose.yml in current directory
$ expose init
βœ“ Config created: .expose.yml
project: expose
port: 3000

Manage and query configuration values:

expose config list
expose config get port

πŸ— Architecture & Design Principles

expose/
β”œβ”€β”€ cmd/expose/       # CLI entry point (Cobra)
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ cli/          # Cobra subcommands & flag parsing
β”‚   β”œβ”€β”€ config/       # YAML config management
β”‚   β”œβ”€β”€ provider/     # Tunnel providers (LocalTunnel, Cloudflare, Self-Hosted)
β”‚   β”œβ”€β”€ server/       # Self-hosted relay control & public server
β”‚   β”œβ”€β”€ tunnel/       # Core service orchestration & lifecycle
β”‚   └── version/      # Build metadata & version injection
└── .expose.yml       # Local project configuration
  • Interface-Driven: Extensible Provider interface makes adding new tunnel backends straightforward.
  • Clean Separation: CLI β†’ Service β†’ Provider (strict unidirectionality, zero circular dependencies).
  • Fully Testable: High test coverage (>80%) across packages with race detector validation (go test -race).

πŸ§ͺ Development & Testing

# Run all unit tests with Go race detector
go test ./... -v -race -cover

# Package-specific coverage
go test ./internal/tunnel -cover
go test ./internal/server -cover
go test ./internal/provider -cover

🀝 Contributing

Contributions are welcome! Please check out CONTRIBUTING.md for branch strategy, test requirements, and code style guidelines.


πŸ“ License

Distributed under the Apache License 2.0. See LICENSE for details.


Made with ❀️ by @kernelshard

Directories ΒΆ

Path Synopsis
cmd
expose command
internal
cli
pool
Package pool provides reusable buffers for streaming.
Package pool provides reusable buffers for streaming.

Jump to

Keyboard shortcuts

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