curl and proxy

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 3 04:56:00 PDT 2014


On Friday, 3 October 2014 at 11:13:11 UTC, Marc Schütz wrote:
> On Friday, 3 October 2014 at 10:53:27 UTC, Marc Schütz wrote:
>> On Friday, 3 October 2014 at 04:57:28 UTC, AntonSotov wrote:
>>> auto http = HTTP("dlang.org");
>>> http.onReceive = (ubyte[] data)
>>> {
>>>   writeln(cast(string) (data));
>>>   return data.length;
>>> };
>>> http.proxy = "192.168.111.111";
>>> http.proxyPort = 1788;
>>>
>>> WHAT HERE ?
>>>
>>> http.perform();
>>> //////////////////////////////////
>>> how to make Сurl authorize on a proxy.
>>> I specify proxyUser and proxyPassword?
>>
>> I think there's currently no way. curl provides this as an 
>> option (CurlOption.proxyuserpwd):
>>
>>    curl.set(CurlOption.proxyuserpwd, "myuser:mypasswd");
>>
>> But unfortunately the `curl` struct is a private member of 
>> `HTTP`...
>
> https://github.com/D-Programming-Language/phobos/pull/2581
>
> If you're able to build Phobos, could you give this PR a try? I 
> cannot test it myself, because I don't know of a proxy 
> requiring authentication.

Works OK for me

Thanks


More information about the Digitalmars-d-learn mailing list