当前位置: 首页 > Skill >

Live Preview

Live Preview

Live Preview

通过aitun隧道分享开发中网站的实时预览,支持热重载功能,让用户在您编辑时即时查看更改。非常适合AI应用开发。

1.0.6 2026.11.18 373
获取Skill文件查看使用说明
作 者:叶安 许可证: 更新时间:2026.11.18
本文目录展开

Live Preview - Share Real-Time Website Preview via Aitun Tunnel

When to Use

Use this skill when:

  • You are iteratively building or modifying a website and want the user to see live changes
  • You need user feedback on a design while you continue editing
  • You are prototyping a UI and want to share each iteration instantly
  • You are debugging a web application and need the user to confirm fixes in real time
  • You want to demo a development workflow where changes appear live

Do NOT use this skill when:

  • The website is already deployed to a public server
  • You only need a one-time share (use aitun-tunnel instead)
  • The content is a static file that does not change (use sendfile instead)

Instructions

Step 1: Install aitun

pip install aitun

Or install via one-line script (Linux/macOS):

curl -fsSL https://aitun.cc/install.sh | bash

Windows (PowerShell):

irm https://aitun.cc/install.ps1 | iex

Or verify it is already installed:

which aitun

Step 2: Start the development server

Start the local dev server with hot-reload enabled. The command depends on your framework:

# For a static HTML directory (use a live-reload tool)
pip install livereload
python3 -c "
from livereload import Server, shell
server = Server()
server.watch('/path/to/html/dir')
server.serve(root='/path/to/html/dir', port=8080)
" &
DEV_PID=$!
sleep 2

# For Next.js
npm run dev -- -p 8080 &

# For Vite
npx vite --port 8080 --host &

# For Flask
flask run --port 8080 --host 0.0.0.0 &

# For any HTTP server (no auto-reload)
python3 -m http.server 8080 --directory /path/to/html/dir &

Step 3: Create a tunnel

Expose the dev server to the internet:

aitun -p 8080 &
AITUN_PID=$!
sleep 3

The output will contain the public URL, e.g.:

  • https://aitun.cc/abc123

Step 4: Share the preview link with the user

Your live preview is ready: https://aitun.cc/abc123

I'm still working on it — just refresh the page to see my latest changes.
This preview link will remain active while I'm editing.

Step 5: Iterate and update

Continue editing files in your project directory. As you save changes:

  • If using a hot-reload dev server: the user's browser will auto-refresh
  • If using a basic HTTP server: tell the user to refresh the page manually

After each significant change, notify the user:

I've updated the navigation bar — refresh the page to see it.

Step 6: Clean up

When the preview session is complete, stop the servers:

kill $AITUN_PID 2>/dev/null
kill $DEV_PID 2>/dev/null

CLI Reference

The aitun command (installed via pip install aitun, or alternatively curl -fsSL https://aitun.cc/install.sh | bash / irm https://aitun.cc/install.ps1 | iex on Windows) accepts these flags:

Flag Description
-p PORT Local HTTP service port (optional; omit for TCP-only mode with --tcp-ports)
-k TOKEN Auth token for registered subdomain (omit for free tunnel)
--host HOST Local service address (default: localhost)
--tcp-ports PORTS TCP forwarding ports, comma-separated (e.g., 22,3306; requires -k). Use without -p for TCP-only mode
--p2p Enable P2P direct connection (default: enabled)
--no-p2p Disable P2P, force server relay mode
--daemon Run as background daemon
--stop Stop running daemon

Notes

  • Free tunnels use proxy address mode (path-based URL like aitun.cc/abc123), NOT subdomains
  • Free tunnels expire after 24 hours, auto-renewed on restart
  • For a permanent preview subdomain, register at https://aitun.cc
  • Hot-reload works best with frameworks that support it natively (Vite, Next.js, etc.)
  • For static files, use Python's livereload package to enable auto-refresh
  • The tunnel stays active as long as the aitun process is running — no need to restart the tunnel when files change
  • All traffic is encrypted end-to-end

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • Live Preview - Share Real-Time Website Preview via Aitun Tunnel
    • When to Use
    • Instructions
      • Step 1: Install aitun
      • Step 2: Start the development server
      • Step 3: Create a tunnel
      • Step 4: Share the preview link with the user
      • Step 5: Iterate and update
      • Step 6: Clean up
    • CLI Reference
    • Notes
  • 项目或源文件

相关 Skill

更多
Local Markdown Editor with Live Preview 本地Markdown网页编辑器 Local Markdown Editor with Live Preview 本地Markdown网页编辑器 基于Flask的本地Markdown编辑器,支持实时编辑、实时预览与同步滚动。
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...