Skip to content

kernelshard/expose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

58 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Expose

Expose Social Preview

Tests Go Report Card License: MIT

The open-source, single-binary 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
go install github.com/kernelshard/expose/cmd/expose@latest

# 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. Download Binary (Recommended)

Download the latest binary for your OS (Windows, macOS, Linux) from the Releases Page. Unzip it and add it to your PATH.

2. Using Go Install

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

MIT License - see LICENSE for details.


Made with โค๏ธ by @kernelshard

About

Open-source tunneling CLI that exposes localhost to shareable URLs. Built with Go, zero config, perfect for demos and webhook testing.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages