diff --git a/include/zarr.h b/include/zarr.h index 5794add..5c316a7 100644 --- a/include/zarr.h +++ b/include/zarr.h @@ -94,6 +94,7 @@ class ZarrFunctions: public ZarrTypes std::unique_ptr cache; CURLRAII chandle; MString url; + MString proxyurl; std::vector> chunks; @@ -107,6 +108,8 @@ class ZarrFunctions: public ZarrTypes { auto oldprefix = michlib::GPL.UsePrefix("ZARR"); cache.reset(CreateCache(michlib::GPL.ParameterSValue("Cache", ""))); + proxyurl = michlib::GPL.ParameterSValue("Proxy", ""); + if(proxyurl.Exist()) curl_easy_setopt(chandle, CURLOPT_PROXY, proxyurl.Buf()); michlib::GPL.UsePrefix(oldprefix); if(!cache) { diff --git a/src/zarr.cpp b/src/zarr.cpp index 3eafa63..006a707 100644 --- a/src/zarr.cpp +++ b/src/zarr.cpp @@ -171,6 +171,7 @@ Error ZarrFunctions::GetChunk(const MString& var, const std::vector& chu { michlib::message(str + " not found in cache, downloading"); CURLRAII myhandle; // TODO: remove this workaround of unknown bug + if(proxyurl.Exist()) curl_easy_setopt(myhandle, CURLOPT_PROXY, proxyurl.Buf()); //auto [out, res] = GetUrl(chandle, str); auto [out, res] = GetUrl(myhandle, str); if(res != CURLE_OK) return Error(pref, MString("can't download chunk: ") + chandle.Err());