ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# getRemoteIp ## 说明: ```php string Connection::getRemoteIp() ``` 获得该连接的客户端ip ## 参数 无参数 ## 范例 ```php use Workerman\Worker; require_once __DIR__ . '/Workerman/Autoloader.php'; $worker = new Worker('websocket://0.0.0.0:8484'); $worker->onConnect = function($connection) { echo "new connection from ip " . $connection->getRemoteIp() . "\n"; }; // 运行worker Worker::runAll(); ```