<?php namespace app\index\controller; use think\Controller; use \GatewayClient\Gateway; class News extends Controller { public function test(){ $Gateway = new Gateway(); $Gateway::$registerAddress = '127.0.0.1:2345'; $Gateway::sendToAll('来自服务端client的主动推送'.date('Y-m-d H:i:s')); } }