untun
Version, currently 0.1.04 versions
- 0.1.3latestSep 21, 2025
- 0.1.2not indexedSep 21, 2025
- 0.1.1not indexedSep 21, 2025
- 0.1.0not indexedSep 21, 2025
github.com/krthr/untun.cr
Tunnel your local HTTP(s) server to the world! A Crystal port of untun, powered by Cloudflare Quick Tunnels. Crystal port of https://github.com/unjs/untun
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
untun:
github: krthr/untun.cr
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
untun
๐ Tunnel your local HTTP(s) server to the world! Powered by ๐ฅ Cloudflare Quick Tunnels.
A Crystal port of unjs/untun.
Overview
untun allows you to expose your local HTTP(s) server to the internet using Cloudflare's free Quick Tunnels service. No account required!
Installation
From Source
-
Clone the repository:
git clone https://github.com/krthr/untun cd untun -
Build the project:
shards build --release -
The binary will be available at
./bin/untun
As a Dependency
Add this to your application's shard.yml:
dependencies:
untun:
github: krthr/untun
Usage
CLI
Start a tunnel to your local server:
# Tunnel a local server running on port 3000 (default)
./bin/untun
# Tunnel a specific port
./bin/untun --port 8080
# Tunnel a specific URL
./bin/untun --url http://localhost:4000
# Tunnel with HTTPS
./bin/untun --protocol https --port 443
# Show help
./bin/untun --help
Programmatic Usage
require "untun"
# Start a tunnel with default settings
tunnel = Untun.start_tunnel
# Start a tunnel with custom settings
tunnel = Untun.start_tunnel(
port: 8080,
hostname: "localhost",
protocol: "http",
accept_cloudflare_notice: true
)
if tunnel
# Get the public URL (blocks until ready)
spawn do
url = tunnel.url.receive
puts "Tunnel ready at: #{url}"
end
# Keep the tunnel running
sleep
# Or stop it manually
tunnel.stop
end
Options
CLI Options
-u, --url URL- The URL to tunnel (overrides port/hostname/protocol)-p, --port PORT- The port to tunnel (default: 3000)--hostname HOST- The hostname to tunnel (default: localhost)--protocol PROTO- The protocol to use: http or https (default: http)-v, --version- Show version-h, --help- Show help
Environment Variables
UNTUN_ACCEPT_CLOUDFLARE_NOTICE- Set to any value to automatically accept Cloudflare's termsLOG_LEVEL- Set the log level (e.g., DEBUG, INFO, WARN, ERROR)CLOUDFLARED_VERSION- Override the cloudflared version to download
Features
- ๐ Zero Configuration - Just run and get a public URL
- ๐ Secure - All tunnels use HTTPS on the public side
- ๐ฆ Self-contained - Automatically downloads cloudflared binary if needed
- ๐ Graceful Shutdown - Handles Ctrl+C and cleanup properly
- ๐ง Flexible - Use via CLI or as a library in your Crystal application
How It Works
untun uses Cloudflare's Quick Tunnels feature through the cloudflared binary. When you start a tunnel:
- It checks if
cloudflaredis installed, and downloads it if necessary - Starts the tunnel process pointing to your local server
- Extracts and returns the public HTTPS URL
- Keeps the tunnel running until you stop it
Development
- Clone the repository
- Install dependencies:
shards install - Run tests:
crystal spec - Build for development:
shards build
Contributing
- Fork it (https://github.com/krthr/untun/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Acknowledgments
This is a Crystal port of the excellent unjs/untun project. All credit for the concept goes to the original authors.
License
MIT License - see LICENSE for details.
Note: Your use of the cloudflared binary is subject to the Cloudflare Terms of Service and Privacy Policy.
Contributors
- Wilson Tovar - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Sep 21, 2025
- Commit
6a5271cc1634- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/krthr/untun.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 4