logo
0
0
WeChat Login
akazwz<akazwz@pm.me>
feat: update version to 1.2.1; fix terminal QR code rendering compatibility
hostc logo

hostc

Localhost to the edge.

Secure, fast, and frictionless edge tunnels. Powered by Cloudflare Workers.


hostc is a modern, lightweight, and zero-configuration tool to instantly expose your local HTTP and WebSocket services to the public internet. Built entirely on top of Cloudflare Workers and Durable Objects for global low-latency edge networking.

✨ Features

  • Zero Config: Just run one command and get a public HTTPS URL.
  • WebSocket Support: Seamlessly proxies WebSocket upgrades (ws:// -> wss://) out of the box.
  • Edge Powered: Traffic is routed through Cloudflare's massive global network network.
  • Self-Hostable: You can easily deploy the worker to your own Cloudflare account.

🚀 Quick Start

You don't even need to install anything if you have Node.js. Just run:

npx hostc 3000

Or, install it globally for frequent use:

npm install -g hostc hostc 3000

Public URL: You'll instantly get a URL like https://t-a1b2c3d4.hostc.dev that routes traffic directly to your http://127.0.0.1:3000.

🏗️ Architecture & Monorepo

This project is a Monorepo managed by pnpm.

Package / AppDescription
apps/cliThe Node.js command-line interface tool.
apps/workersThe Cloudflare Worker and Durable Object handling the tunnel connections.
packages/tunnel-protocolShared protocol and WebSocket message types.

🛠️ Local Development

Requirements

  • Node.js 18+
  • pnpm v8+
  • A Cloudflare account (if you want to deploy the worker yourself)

Setup

  1. Install dependencies

    pnpm install
  2. Run the Cloudflare Worker locally

    pnpm dev:workers
  3. Run the CLI locally against your local worker

    cd apps/cli pnpm dev # Or using the environment variable with the built CLI: HOSTC_SERVER_URL=http://127.0.0.1:8787 hostc 3000

📖 License

Apache License 2.0. Made with ❤️ by akazwz.

About

这是一个基于自定义工作流自动创建的临时仓库

17.24 MiB
0 forks0 stars2 branches0 TagREADMEApache-2.0 license
Language
TypeScript47.5%
JavaScript34.3%
HTML14.7%
CSS3.5%