Giter Club home page Giter Club logo

Comments (6)

yellow1912 avatar yellow1912 commented on July 28, 2024

Perhaps it has to do with the site behind cloudflare and on http2?

Edit:
I tried to comment out setDefer in the Request file and that seems to work, why?

/** Set defer and timeout */
$this->client->setDefer(); //总是延迟回包以使用timeout定时器特性

from saber.

yellow1912 avatar yellow1912 commented on July 28, 2024

@twose Can I send you a private message to include the https link that I'm trying to access together with the complete code I'm using to test so you can take a look for me please?

For example, in your document, you use httpbin, if I try it like this

$responses = \Swlib\SaberGM::requests([
            ['uri' => 'https://httpbin.org'],
        ]);

I will get

[2018-12-07 09:15:40 @7111.0] WARNING swSSL_connect: SSL_connect(fd=5) failed. Error: (null)[1|0].
PHP Fatal error: Uncaught Swlib\Http\Exception\ConnectException: HTTP -1 Unknown: Connect timeout! the server is not listening on the port or the network is missing! in /myfolder/workers/swoole-workers/vendor/swlib/saber/src/Request.php:641
Stack trace:
#0 /myfolder/workers/swoole-workers/vendor/swlib/saber/src/RequestQueue.php(117): Swlib\Saber\Request->recv()
#1 /myfolder/workers/swoole-workers/vendor/swlib/saber/src/Saber.php(278): Swlib\Saber\RequestQueue->recv()
#2 /myfolder/workers/swoole-workers/vendor/swlib/saber/src/SaberGM.php(90): Swlib\Saber->requests(Array, Array)
#3 /myfolder/workers/swoole-workers/monitor.php(51): Swlib\SaberGM::requests(Array)
#4 {main}
thrown in /myfolder/workers/swoole-workers/vendor/swlib/saber/src/Request.php on line 641

php --ri swoole

swoole support => enabled
Version => 4.2.10-alpha
Author => Swoole Group[email: [email protected]]
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1 11 Sep 2018
http2 => 1.36.0-DEV
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608

from saber.

twose avatar twose commented on July 28, 2024

if you comment out setDefer in the Request file, it should never work.
it's so strange, look like openssl library error, I will try to find the solution.

from saber.

twose avatar twose commented on July 28, 2024

It's a design bug, we must use this way to make it work, I will fix it soon and release a new version (Saber). (maybe it will also be an enhancement in the swoole kernel).

    echo SaberGM::psr([
        'uri' => 'https://httpbin.org/get',
        'ssl_verify_peer' => true,
        'ssl_host_name' => 'httpbin.org'
    ])->withCAFile()->exec()->recv();

from saber.

twose avatar twose commented on July 28, 2024

most of the https servers need not use this way.

from saber.

yellow1912 avatar yellow1912 commented on July 28, 2024

Thanks @twose, I noticed that some servers dont need that as well? For my case I know my server is using the cert from letsencrypt, and then the DNS is done by cloudflare. Is this combination the cause of the issue?

Edit: I can verify that you suggested change does work, thank you alot.

from saber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.