fetchurl: add proxy configuration option
This commit is contained in:
committed by
Norman Feske
parent
ba95c6834f
commit
78b6096fa5
@@ -11,3 +11,8 @@ Configuration
|
||||
! </libc>
|
||||
! <fetch url="http://genode.org/about/LICENSE" path="LICENSE"/>
|
||||
!</config>
|
||||
|
||||
Optionally, you can use a proxy:
|
||||
|
||||
! <fetch url="http://genode.org/about/LICENSE" path="LICENSE"
|
||||
! proxy="sock5://10.0.0.1:9050 />
|
||||
|
||||
@@ -135,6 +135,13 @@ void Component::construct(Genode::Env &env)
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
/* check for optional proxy configuration */
|
||||
try {
|
||||
Genode::String<256> proxy;
|
||||
node.attribute("proxy").value(&proxy);
|
||||
curl_easy_setopt(curl, CURLOPT_PROXY, proxy.string());
|
||||
} catch (...) { }
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
close(fd);
|
||||
if (res != CURLE_OK)
|
||||
|
||||
Reference in New Issue
Block a user