walkor / workerman

An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols.
http://www.workerman.net
MIT License
11.12k stars 2.26k forks source link

$request->host() 无法返回正确的ipv6地址 #916

Closed wwng2333 closed 1 year ago

wwng2333 commented 1 year ago

如题,在使用ipv6地址,直接使用ip访问时,无法返回正确的地址,如图 image 测试代码:

<?php
use Workerman\Worker;
use Workerman\Connection\TcpConnection;
use Workerman\Protocols\Http\Request;
require_once __DIR__ . '/vendor/autoload.php';

$http_worker = new Worker("http://[::]:2345");
$http_worker->count = 1;
$http_worker->onMessage = function(TcpConnection $connection, Request $request)
{
    $connection->send($request->host(true));
};

Worker::runAll();
walkor commented 1 year ago

感谢反馈,主干已经修复,等下个版本发布