jae-jae / QueryList

:spider: The progressive PHP crawler framework! 优雅的渐进式PHP采集框架。
https://querylist.cc
2.65k stars 440 forks source link

cURL error 56: Recv failure: Connection reset by peer #88

Closed xtf-php closed 3 years ago

xtf-php commented 4 years ago

$ql = QueryList::get('https://www.xiaohongshu.com/discovery/item/5da33f440000000001009d1c' ,[],[ 'verify'=>false, 'proxy' => '58.218.200.253:8614',// 设置代理 //设置超时时间,单位:秒 'timeout' => 30, ]);

我本地开发环境使用可以查询 放到linux服务器上 会报这个错误(cURL error 56: Recv failure: Connection reset by peer) 找了好久没看到哪里的问题

jae-jae commented 3 years ago

代理使用例子:

$ql = QueryList::get('http://httpbin.org/get',[
    'param1' => 'testvalue',
    'params2' => 'somevalue'
],[
    // 设置代理
    'proxy' => 'http://222.141.11.17:8118',
    //设置超时时间,单位:秒
    'timeout' => 30,
    'headers' => [
        'Referer' => 'https://querylist.cc/',
        'User-Agent' => 'testing/1.0',
        'Accept'     => 'application/json',
        'X-Foo'      => ['Bar', 'Baz'],
        'Cookie'    => 'abc=111;xxx=222'
    ]
]);