expose

module
v0.5.0 Latest Latest
Warning

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

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

README ΒΆ

πŸš€ Expose

Expose Social Preview

Downloads Documentation Tests Go Report Card

The open-source, pure Go (Golang) alternative to ngrok. Expose your local localhost server to the internet with zero config, zero signup, and zero hassle.

Expose is a modern Go-based tunneling tool that lets you share your local development environment with the world. Perfect for testing webhooks, mobile debugging, or showing off your work on localtunnel or Cloudflare networks.

πŸ†š Why Expose?

Feature πŸš€ Expose ngrok Cloudflare Tunnel LocalTunnel (Node)
No Signup Required βœ… ❌ ❌ βœ…
Single Binary βœ… βœ… βœ… ❌ (requires Node.js)
Open Source βœ… ❌ βœ… βœ…
Self-Hosted Server βœ… ❌ ❌ ❌
Language Go Go Go JS
Free Custom Domains 🚧 (Planned) πŸ’² Paid βœ… ❌

✨ Features

  • 🌐 Multiple Providers: LocalTunnel, Cloudflare, or your own self-hosted server.
  • 🏠 Self-Hosted: Run expose server on any $5 VPS β€” full control, no third parties.
  • ⚑ Zero Friction: No accounts, no auth tokens, just run and go.
  • πŸ“¦ Lightweight: A single <10MB binary with no external dependencies.
  • πŸ”§ Developer Friendly: Written in pure Go, easy to contribute to.

πŸš€ Quick Start

# Install (macOS & Linux)
curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh

# Initialize config
expose init

# Start tunnel (defaults to port 3000)
expose tunnel
Or use Cloudflare
expose tunnel -P cloudflare -p 8080
Or use your own self-hosted server
# On your VPS β€” one-time setup
expose server --domain=tunnel.mysite.com --control-port=7890 --public-port=8080

# On your laptop β€” just works
expose tunnel --server=tunnel.mysite.com:7890

πŸ“¦ Installation
1. Homebrew (macOS & Linux)
brew install kernelshard/tap/expose
2. Shell Script (macOS & Linux)

Install the latest pre-compiled binary with a single command:

curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh

You can customize the destination directory or pin a specific version:

# Install a specific version
VERSION=v0.5.0 curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh

# Install into a custom directory (defaults to /usr/local/bin or ~/.local/bin)
BINDIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh
3. Pre-built Binaries

Download the latest binary for your operating system (macOS, Linux, Windows) from the Releases Page. Extract the archive and place expose in your $PATH.

4. Using Go Install

Requires Go 1.21+:

go install github.com/kernelshard/expose/cmd/expose@latest
From Source
git clone https://github.com/kernelshard/expose.git
cd expose
go build -o expose ./cmd/expose
./expose --version

πŸ“– Usage

Initialize Configuration
$ expose init
βœ“ Config created: .expose.yml

Creates .expose.yml in current directory:

project: expose
port: 3000
Start Tunnel
# Use config port
$ expose tunnel
βœ“ Tunnel (LocalTunnel) started for localhost:3000
βœ“ Public URL: https://quick-mammals-sing.loca.lt
βœ“ Forwarding to http://localhost:3000
βœ“ Provider: LocalTunnel
βœ“ Press Ctrl+C to stop

# Override port
$ expose tunnel --port 8080
Manage Configuration
# List all config values
$ expose config list
project: expose
port: 3000

# Get specific value
$ expose config get port
3000

$ expose config get project
expose

βœ… Tested Locally

$ expose --version
expose version v0.1.2 (commit: d30c483, built: 2025-11-10)

$ expose init
βœ“ Config created: .expose.yml (project: expose, port: 3000)

$ python3 -m http.server 3000 &
Serving HTTP on 0.0.0.0 port 3000...

$ expose tunnel
πŸš€ Tunnel[LocalTunnel] started for localhost:3000
βœ“ Public URL: https://ripe-garlics-add.loca.lt
βœ“ Forwarding to: http://localhost:3000
βœ“ Provider: LocalTunnel
Press Ctrl+C to stop

$ curl https://ripe-garlics-add.loca.lt
<!DOCTYPE HTML>...  # Works!

Tested on: Go 1.23, macOS 14, Ubuntu 22.04


πŸ— Architecture

expose/
β”œβ”€β”€ cmd/expose/       # CLI entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ cli/          # Cobra commands (thin layer)
β”‚   β”œβ”€β”€ config/       # YAML config management
β”‚   β”œβ”€β”€ provider/     # Tunnel provider implementations
β”‚   β”œβ”€β”€ server/       # Self-hosted tunnel server
β”‚   β”œβ”€β”€ tunnel/       # Service layer (business logic)
β”‚   └── version/      # Version metadata
└── .expose.yml       # User config (add to .gitignore per project)

Design principles:

  • Interface-driven β€” Provider interface supports multiple tunnel backends
  • Clean separation β€” CLI β†’ Service β†’ Provider (no circular deps)
  • Testable β€” Real file tests, injectable service layer

⚠️ Known Limitations

  • One tunnel per process β€” Each expose tunnel command runs independently (can run multiple on different ports)
  • No persistence β€” Public URLs change on restart
  • CLI-only β€” No web UI or dashboard yet

See GitHub Issues for roadmap.


πŸ§ͺ Development

Prerequisites
  • Go 1.23+
  • Git
Setup
git clone https://github.com/kernelshard/expose.git
cd expose
go mod download
Run Tests
# Run all tests with race detector
go test ./... -v -race -cover

# Check coverage for specific packages
go test ./internal/config -cover
go test ./internal/tunnel -cover
go test ./internal/provider -cover
Build
go build -o expose ./cmd/expose
./expose --version
Run Locally
# Without installing
go run cmd/expose/main.go tunnel

# Test with live server
python3 -m http.server 3000  # Terminal 1
./expose tunnel              # Terminal 2

🀝 Contributing

Contributions welcome! See CONTRIBUTING.md for:

  • Development workflow
  • Branch strategy
  • Testing requirements
  • Code style guidelines

πŸ“ License

Apache License 2.0 - see LICENSE for details.


Made with ❀️ by @kernelshard

Directories ΒΆ

Path Synopsis
cmd
expose command
internal
cli

Jump to

Keyboard shortcuts

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