Test.php 549 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use Redis;
  5. use \GatewayWorker\Lib\Gateway;
  6. class Test extends Controller
  7. {
  8. public function test(){
  9. $Gateway = new Gateway();
  10. $Gateway::$registerAddress = '127.0.0.1:2345';
  11. $Gateway::sendToAll('来自服务端的主动推送'.date('Y-m-d H:i:s'));
  12. }
  13. public function ip(){
  14. $ipaddress = ip_to_address();
  15. echo $ipaddress;
  16. }
  17. public function newip(){
  18. $ipaddress = newip_to_address();
  19. echo $ipaddress;
  20. }
  21. }