/~learn/s/99e921ae
localhost:8765 运行https://adata-charts.loca.lt(国内无需 VPN)
一个开源免费的内网穿透工具,零注册、零付费。
loca.lt 服务器之间建立加密隧道,公网请求通过隧道转发到你本地
npx localtunnel --port 8765 --subdomain adata-charts
--port 8765:转发本地 8765 端口--subdomain adata-charts:固定子域名,重启后地址不变
首次打开 https://adata-charts.loca.lt 会看到确认页,点一下 "Click to Continue" 即可。
| 原因 | 说明 |
| ------ | ------ |
| 为什么有? | localtunnel 的防滥用机制,阻止恶意机器人扫描内网 |
| 多久弹一次? | 同浏览器同域名,24 小时内不会重复弹出 |
| 能跳过吗? | 对普通浏览器来访者无法完全跳过。但你可以告诉朋友:第一次点一下按钮就行,之后不会再弹 |
| 方案 | 成本 | 注册 | 固定域名 | 国内速度 |
| ------ | ------ | ------ | --------- | --------- |
| localtunnel(当前) | 免费 | 不需要 | ✅ 支持 | 中等 |
| ngrok | 免费 | 需注册 | 免费版随机 | 慢(国外服务器) |
| Cloudflare Tunnel | 免费 | 需注册 | 需域名 | 好 |
| 阿里云ECS + Nginx | ~¥50/月 | 需购买 | ✅ | 快 |
``bash
cd /tmp/valuation_charts && python3 -m http.server 8765
`
`bash
npx localtunnel --port 8765 --subdomain adata-charts
`