digitalmars.D.learn - curl and proxy
- AntonSotov (13/13) Oct 02 2014 auto http = HTTP("dlang.org");
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (6/19) Oct 03 2014 I think there's currently no way. curl provides this as an option
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (5/26) Oct 03 2014 https://github.com/D-Programming-Language/phobos/pull/2581
- Daniel Kozak (3/32) Oct 03 2014 Works OK for me
- notna (8/37) Oct 04 2014 Cool,thanks.
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (5/10) Oct 05 2014 Does std.uri.encode() not take care of these either? Anyway,
- Sag Academy (2/23) Oct 06 2014 satisfied with your answer.
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?
Oct 02 2014
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`...
Oct 03 2014
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: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.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`...
Oct 03 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:Works OK for me ThanksOn Friday, 3 October 2014 at 04:57:28 UTC, AntonSotov wrote: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.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`...
Oct 03 2014
Cool,thanks. Btw., there could be more special chars to encode...replace beside ":"... like / and so on... see also http://www.cyberciti.biz/faq/unix-linux-export-variable-http_proxy-with special-characters/ for the background Regards notna 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: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.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`...
Oct 04 2014
On Saturday, 4 October 2014 at 21:59:43 UTC, notna wrote:Cool,thanks. Btw., there could be more special chars to encode...replace beside ":"... like / and so on... see also http://www.cyberciti.biz/faq/unix-linux-export-variable-http_proxy-with special-characters/ for the backgroundDoes std.uri.encode() not take care of these either? Anyway, according to the documentation [1], it effectively only cares for ":". Therefore, I removed the calls to encode(). [1] http://curl.haxx.se/libcurl/c/CURLOPT_PROXYUSERPWD.html
Oct 05 2014
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:satisfied with your answer.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`...
Oct 06 2014