一. 花生壳
官网:https://hsk.oray.com/
教程:https://service.oray.com/question/2480.html
- 默认只有tcp,其他服务(如http)需花钱开通,最低6元。
- 映射可能出现各种问题,比如:“域名IP地址指向”与“转发服务器IP”不一致,导致连接失败(我使用ipv4的本机ip出现了这种情况而连接失败,改为127.0.0.1后,连接成功)。
二. NATAPP
官网:https://natapp.cn/
- 使用步骤类似花生壳,可创建免费隧道。
- 需要实名认证,支付宝授权
- 下载客户端
三. localtunnel(免费,推荐)
教程:https://segmentfault.com/a/1190000014807448
npm install -g localtunnel
lt --subdomain <个性前缀> --port <要映射的端口>
例如, 本地项目地址为:http://localhost:3000
添加前置为:lt --subdomain test --port 3000
映射地址为:https://test.loca.lt