We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.2.28 (cli) (built: Mar 11 2025 17:58:12) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.28, Copyright (c) Zend Technologies with Zend OPcache v8.2.28, Copyright (c), by Zend Technologies swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 6.0.2 Built => May 27 2025 09:11:27 coroutine => enabled with boost asm context kqueue => enabled rwlock => enabled sockets => enabled openssl => OpenSSL 1.1.1v 1 Aug 2023 dtls => enabled http2 => enabled json => enabled curl-native => enabled curl-version => 8.13.0 zlib => 1.2.12 brotli => E16781312/D16781312 zstd => 1.5.7 mysqlnd => enabled Directive => Local Value => Master Value swoole.enable_library => On => On swoole.enable_fiber_mock => Off => Off swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => Off => Off swoole.unixsock_buffer_size => 262144 => 262144
// test.php <?php require_once __DIR__ . '/vendor/autoload.php'; use Swoole\Coroutine; use function Swoole\Coroutine\run; run(function () { Coroutine::create(function(){ $client = new \GuzzleHttp\Client(); $response = $client->get('https://httpbin.org/stream/20', [ 'stream' => true, ]); $body = $response->getBody(); while (!$body->eof()) { echo $body->read(1024); } }); });
php test.php
PHP Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: Connection refused for URI https://httpbin.org/stream/20 in /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:341 Stack trace: #0 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(254): GuzzleHttp\Handler\StreamHandler->GuzzleHttp\Handler\{closure}() #1 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(335): GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure)) #2 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(70): GuzzleHttp\Handler\StreamHandler->createStream(Object(GuzzleHttp\Psr7\Request), Array) #3 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #4 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #5 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #6 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #7 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #8 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #9 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #10 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array) #11 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync('GET', Object(GuzzleHttp\Psr7\Uri), Array) #12 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://httpbin...', Array) #13 /Users/hdj/github/huangdijia/odin-demo/test.php(11): GuzzleHttp\Client->get('https://httpbin...', Array) #14 [internal function]: {closure}() #15 {main} Next GuzzleHttp\Exception\ConnectException: Connection refused for URI https://httpbin.org/stream/20 in /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:84 Stack trace: #0 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #1 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #2 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #3 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #4 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #5 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #6 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #7 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array) #8 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync('GET', Object(GuzzleHttp\Psr7\Uri), Array) #9 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://httpbin...', Array) #10 /Users/hdj/github/huangdijia/odin-demo/test.php(11): GuzzleHttp\Client->get('https://httpbin...', Array) #11 [internal function]: {closure}() #12 {main} thrown in /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 84 Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: Connection refused for URI https://httpbin.org/stream/20 in /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:341 Stack trace: #0 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(254): GuzzleHttp\Handler\StreamHandler->GuzzleHttp\Handler\{closure}() #1 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(335): GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure)) #2 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(70): GuzzleHttp\Handler\StreamHandler->createStream(Object(GuzzleHttp\Psr7\Request), Array) #3 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #4 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #5 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #6 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #7 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #8 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #9 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #10 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array) #11 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync('GET', Object(GuzzleHttp\Psr7\Uri), Array) #12 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://httpbin...', Array) #13 /Users/hdj/github/huangdijia/odin-demo/test.php(11): GuzzleHttp\Client->get('https://httpbin...', Array) #14 [internal function]: {closure}() #15 {main} Next GuzzleHttp\Exception\ConnectException: Connection refused for URI https://httpbin.org/stream/20 in /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:84 Stack trace: #0 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #1 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #2 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #3 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #4 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #5 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #6 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #7 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array) #8 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync('GET', Object(GuzzleHttp\Psr7\Uri), Array) #9 /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'https://httpbin...', Array) #10 /Users/hdj/github/huangdijia/odin-demo/test.php(11): GuzzleHttp\Client->get('https://httpbin...', Array) #11 [internal function]: {closure}() #12 {main} thrown in /Users/hdj/github/huangdijia/odin-demo/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php on line 84
The text was updated successfully, but these errors were encountered:
相关issue:hyperf/odin#9
Sorry, something went wrong.
我找到问题了,问题在于 openssl => OpenSSL 1.1.1v 1 Aug 2023 ,换成 openssl => OpenSSL 3.5.0 8 Apr 2025 就可以了。
openssl => OpenSSL 1.1.1v 1 Aug 2023
openssl => OpenSSL 3.5.0 8 Apr 2025
Connection refused 一般是端口未监听。
如果切换 openssl 版本可以解决,可能问题是出现在 SSL handshake 阶段。建议通过 strace 追踪一下,另外可使用
openssl s_client httpbin.org:443
验证是否可以连接
No branches or pull requests
PHP&Swoole 版本
代码
运行
错误
The text was updated successfully, but these errors were encountered: