box icon indicating copy to clipboard operation
box copied to clipboard

希望支持curl代理配置

Open buexplain opened this issue 2 years ago • 5 comments

F:\swow>box.exe self-update
[ERROR] cURL error 56: OpenSSL SSL_read: Connection was reset, errno 10054 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://raw.githubusercontent.com/hyperf/box/master/pkgs.json
App\PkgDefinitionManager::getPkgs(): Return value must be of type array, null returned

不知道支持curl的代理后能不能解决问题。

buexplain avatar Dec 12 '22 10:12 buexplain

设置环境变量不就好了?

twose avatar Dec 12 '22 10:12 twose

设置环境变量不就好了?

F:\swow>set http_proxy=127.0.0.1
F:\swow>set http_proxy_port=9999
F:\swow>box.exe self-update
[ERROR] cURL error 6: Could not resolve host: raw.githubusercontent.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://raw.githubusercontent.com/hyperf/box/master/pkgs.json
App\PkgDefinitionManager::getPkgs(): Return value must be of type array, null returned
F:\swow>set http_proxyport=9999
F:\swow>box.exe self-update
[ERROR] cURL error 6: Could not resolve host: raw.githubusercontent.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://raw.githubusercontent.com/hyperf/box/master/pkgs.json
App\PkgDefinitionManager::getPkgs(): Return value must be of type array, null returned

设置http_proxyhttp_proxy_porthttp_proxyport环境变量后,还是不行。 另外我使用php的curl测试过,我的代理是通的。

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://raw.githubusercontent.com/hyperf/box/master/pkgs.json',
    CURLOPT_SSL_VERIFYHOST => FALSE,
    CURLOPT_SSL_VERIFYPEER => FALSE,
    CURLOPT_PROXY => "127.0.0.1",
    CURLOPT_PROXYPORT => 9999,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

buexplain avatar Dec 13 '22 01:12 buexplain

试试 export http_proxy=127.0.0.1:9999 你先确保你设置环境变量后,用 PHP 的 CURL 不手动设置代理能跑通先

huangzhhui avatar Dec 15 '22 03:12 huangzhhui

试试 export http_proxy=127.0.0.1:9999 你先确保你设置环境变量后,用 PHP 的 CURL 不手动设置代理能跑通先

设置set http_proxy=127.0.0.1:9999后不行,再设置set https_proxy=127.0.0.1:9999也不行。 另外还偶尔会报下面的错误:

F:\swow>box.exe self-update
Class "App\DownloadHandler\BoxException" not found

buexplain avatar Dec 15 '22 08:12 buexplain

你先用别的 get 命令先,这里有个小 bug ,下个版本会 fix

huangzhhui avatar Dec 15 '22 08:12 huangzhhui