suframe/sunny

sunny-ngrok for thinkphp

1.0.1 2019-12-28 06:34 UTC

This package is auto-updated.

Last update: 2024-04-29 04:20:05 UTC


README

感谢http://www.ngrok.cc提供

开发交流QQ群:647344518 立即加群

在开发过程中,经常需要用到外网访问接口,比如公众号,小程序,或者你给客户开发网站系统,客户需要预览等。上传到服务器上调试总是比较麻烦,ngrok可以解决您的这个问题,让你本地开发程序可以外网访问

sunny是一个提供免费和收费内网穿透的工具,此库就是用于集成到thinkphp,让程序可外网访问。支持http,https,tcp转发

可绑定自定义域名或者使用免费3级域名

注册账户:

注意开通隧道的时候如果你想所有人可访问,不要设置http验证用户名和密码

安装:

composer install suframe/sunny

修改config/sunny.php clientid => '上面创建的隧道id',

运行:

运行前请先启动你的项目保证本地可访问,否则转发无法接受数据

php think sunny
# 或者运行原始脚本
php vendor/suframe/sunny/src/sunny.php
#后台运行
setsid php think sunny &
# 关闭后台进程
ps -ef | grep 'php think sunny' | grep -v grep | cut -c 9-15 | xargs kill -9

访问你隧道绑定的或者赠送的域名即可. 开始愉快的开发吧