🚀MSProGateWay 是一个基于PHP + Swoole + Hyperf编写的轻量级,超高性能短信网关,支持SMPP V3.4协议,用于搭建基于SMPP协议的短信服务平台,亦可做为客户端使用。
- Swoole 4.4+
- PHP 7.1+
composer require jenawant/smpp
- 安装
Swoole4.4+
扩展和PHP7.1+
并clone
本项目 cd demo
- 参考
config-sample.ini
生成config.ini
配置文件,按需修改配置文件 php server.php
启动服务端php client.php 1 2
启动客户端模拟发送短信,测试性能。第一个参数代表启动多少个连接 第二个参数代表发送多少条短信
- 参考 Tcp Server配置 章节创建业务类,并参考
demo/server.php
中的逻辑完善业务类 执行命令发布配置php bin/hyperf.php vendor:publish jenawant/smpp
,修改配置文件config/autoload/smpp.php中callbacks
业务类路径- 参考 Tcp Server配置 章节编辑服务器配置,指定端口及回调控制器路径
- 重启服务
demo基于配置文件.ini,实际项目可从config/autoload/smpp.php获取配置。