百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
U

untun

> 编程语言
开源

使用 Cloudflare 快速隧道将您的本地 HTTP(s) 服务器连接到全球!

1.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用 Cloudflare 快速隧道将您的本地 HTTP(s) 服务器连接到全球!

untun

[![npm 版本][npm-version-src]][npm-version-href] [![npm 下载量][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![许可证][license-src]][license-href] 将您的本地 HTTP(s) 服务器隧道到全球! 由 Cloudflare 快速隧道 提供支持,并由 unjs/listhen 使用。

使用方式 (CLI)

使用 npx 在全球运行隧道:

bash
npx untun@latest tunnel http://localhost:3000
◐ Starting cloudflared tunnel to http://localhost:3000
ℹ Waiting for tunnel URL...
✔ Tunnel ready at https://unjs-is-awesome.trycloudflare.com

要了解更多使用信息,请使用 npx untun tunnel --help。

使用 (API)

安装包:

bash
# npm
npm install untun

# yarn
yarn add untun

# pnpm
pnpm install untun

导入:

typescript
// ESM
import { startTunnel } from "untun";

// CommonJS
const { startTunnel } = require("untun");

启动隧道:

typescript
const tunnel = await startTunnel({ port: 3000 });

选项

url

  • 默认值: {protocol}://{hostname}:{port} 用于隧道的本地服务器 URL。

port

  • 默认值: 3000

本地服务器端口(仅当 url 未提供时生效)。

hostname

  • 默认值: localhost

本地服务器主机名(仅当 url 未提供时生效)。

protocol

  • 默认值: http

本地服务器协议(仅当 url 未提供时生效)。

verifyTLS

  • 默认值: false

验证本地服务器 TLS 证书。

  • 克隆此仓库
  • 安装最新的 LTS 版本的 Node.js
  • 使用 corepack enable 启用 Corepack
  • 使用 pnpm install 安装依赖项
  • 使用 pnpm dev 运行交互式测试

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言