A free, open-source ngrok alternative that exposes localhost over HTTPS through Cloudflare Tunnels, with custom subdomains and no account required.
akazwz/hostc
A CLI that gives your local dev server a public HTTPS URL, with WebSockets and hot reload passing through, free and without an account.
Open-source alternative to:ngrok
- Stars
- 628
- Forks
- 69
- Open issues
- 5
- Last commit
- 18 hours ago
What is it?
hostc is a command-line tunnel for sharing a local development server. Running `npx hostc@latest 3000` prints a public HTTPS URL that forwards to localhost:3000, so you can open the app on a phone, send it to a teammate, or receive webhooks from services like Stripe or GitHub.
The CLI needs only Node.js 22 or later, with no sign-up, auth token, or binary to install. It opens one outgoing WebSocket to a server running on Cloudflare Workers and Durable Objects, so nothing on your machine needs to be reachable from the internet. WebSocket traffic and Server-Sent Events pass through, which keeps hot reload working in tools like Vite and Next.js.
Dev servers accept requests addressed to localhost, and redirects point back to the public URL, so no allowed-hosts setting needs changing. If the connection drops, the CLI reconnects and keeps the same URL for up to 10 minutes. The server can also be self-hosted on your own Cloudflare domain.
Key features
- 01Gives a local port a public HTTPS URL with one command.
- 02Passes WebSockets and Server-Sent Events through for hot reload.
- 03Needs no account, auth token, or global install.
- 04Keeps the same URL across brief network drops or server restarts.
- 05Can print a QR code for opening the URL on a phone.
- 06Can be self-hosted on your own Cloudflare domains.
Use cases
- Previewing a site on a real phone with hot reload.
- Testing webhooks from Stripe, GitHub or Slack against local code.
- Sharing work in progress with a teammate or client before deploying.
- Letting an AI coding agent share the app it built.
Quick start
- 1
Start your app, then point hostc at its port
npx hostc@latest 3000
Things to know
- The public URL is open to anyone who has it, so only expose what you mean to share.
- Needs Node.js 22 or later.
- The server is a Cloudflare-based service, and restarting hostc gives a new URL.
In collections
Topics
FAQ
- What is hostc?
- A CLI that gives your local dev server a public HTTPS URL, with WebSockets and hot reload passing through, free and without an account. hostc is a command-line tunnel for sharing a local development server. Running `npx hostc@latest 3000` prints a public HTTPS URL that forwards to localhost:3000, so you can open the app on a phone, send it to a teammate, or receive webhooks from services like Stripe or GitHub.
- Is hostc free to use? What license does it have?
- hostc is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is hostc still maintained?
- Actively maintained. The last commit to hostc was on Nov 5, 2026.
- What can I use hostc for?
- Previewing a site on a real phone with hot reload. Testing webhooks from Stripe, GitHub or Slack against local code. Sharing work in progress with a teammate or client before deploying. Letting an AI coding agent share the app it built.
- How do I install hostc?
- Start your app, then point hostc at its port: npx hostc@latest 3000
- Where can I get hostc?
- The source code and installation instructions are on GitHub: https://github.com/akazwz/hostc
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source ngrok alternative that exposes a local HTTP server at a public HTTPS URL with one command.
A self-hostable, end-to-end encrypted relay that deploys to Cloudflare Workers, letting a phone reach a local desktop port without exposing it.
A minimal Rust CLI that exposes a local TCP port to a remote server, so localhost services can be reached from the public internet.
A self-hosted tunnel written in Go that exposes localhost services to the internet through your own domain and server.
A netcat-like CLI and Go library that connects two machines over Tailscale's WireGuard data plane without needing a Tailscale account or control plane.