[R] win110 + R 4.3.0 dowload only when method = "wininet"
Ivan Krylov
kry|ov@r00t @end|ng |rom gm@||@com
Thu May 11 08:39:25 CEST 2023
On Wed, 10 May 2023 22:13:15 +0000
Sebastián Kruk Gencarelli <zloto_kruk using hotmail.com> wrote:
> I don’t know what kind of proxy is used by my system.
Do you at least know whether it's an HTTP proxy, a SOCKS proxy, or
something completely different? Do you need to authenticate to the
proxy?
> How I can add my proxy and port to my R configuration?
libcurl recognises the "http_proxy" environment variable, which can
include the protocol, the address and the port of the proxy server:
https://curl.se/libcurl/c/CURLOPT_PROXY.html
For example, if you have a SOCKS5 hostname-resolving proxy on address
192.2.0.1 and port 1080, you can try calling Sys.setenv('http_proxy' =
'socks5h://192.2.0.1:1080'). For a different example, an HTTP proxy on
198.51.100.2, port 8080 can be set up as Sys.setenv('http_proxy' =
'http://198.51.100.2:8080'). (In both cases, the proxy will be used by
curl for HTTP and HTTPS access, but not, say, FTP or other protocols.
For HTTPS via HTTP proxy, curl will be using the CONNECT verb.)
Detecting the right proxy for a given address (and yes, it's expected
to do that per-address) is hard™. It's been a "nice to have" feature in
curl for years: https://curl.se/docs/todo.html#auto_detect_proxy, so
I'm afraid it won't happen any time soon. It's unfortunate that the
curl back-end will break something that used to work with wininet.
I wonder whether it could make sense to call
WinHttpGetIEProxyConfigForCurrentUser() [*] when setting up connections
on Windows. There's no simple way to deal with the proxy
auto-configuration file [**], but we could at least call
curl_easy_setopt(handle, CURLOPT_PROXY,
wchar_to_current_locale(proxy_config->lpszProxy)); to make the
transition from wininet to curl slightly less painful. Or would that
break even more installations? This won't help in the more complicated
cases [***], though.
--
Best regards,
Ivan
[*]
https://learn.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpgetieproxyconfigforcurrentuser
[**]
https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file
Then again, library(V8) is nowadays more or less required for R package
development if not R development proper.
[***]
https://stat.ethz.ch/pipermail/r-help/2022-September/475917.html
More information about the R-help
mailing list