| Title: | Tools to Configure Proxy Interactively |
|---|---|
| Description: | Helpers functions and Rstudio Addins to help configure proxy more easily. |
| Authors: | Christophe Dervieux [aut, cre] |
| Maintainer: | Christophe Dervieux <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9002 |
| Built: | 2026-06-10 16:04:01 UTC |
| Source: | https://github.com/cderv/proxyconfig |
This checks for any set environment variable relevant to proxy
is_proxy_activated(verbose = FALSE)is_proxy_activated(verbose = FALSE)
verbose |
if |
TRUE is a proxy is configured. FALSE otherwise.
## Not run: is_proxy_activated(verbose = TRUE) ## End(Not run)## Not run: is_proxy_activated(verbose = TRUE) ## End(Not run)
This will use if available in this order
RStudio IDE prompt
Console input
read_password(prompt)read_password(prompt)
prompt |
text prompt to user |
invisibly the input of the user
if (interactive()) { pwd <- read_password("password") }if (interactive()) { pwd <- read_password("password") }
this will help to set up the proxy configuration using environment variable
url of the proxy with port
authentification if necessary (username and password)
any domain that proxy should ignore
activate or not https proxy
You can set a proxy url across sessions by setting option "proxyconfig.proxy".
set_proxy(proxy = getOption("proxyconfig.proxy", default = NA_character_), username = NULL, password = NULL, noproxy = NULL, https = TRUE)set_proxy(proxy = getOption("proxyconfig.proxy", default = NA_character_), username = NULL, password = NULL, noproxy = NULL, https = TRUE)
proxy |
a character giving the proxy url. By default, it will fetch for
option |
username |
character. If |
password |
character. If |
noproxy |
character vector of domain that proxy should ignore |
https |
logical. If |
TRUE invisibly if no error. Side effects are the environment
variables for proxy being set for the session. You can check them with
base::Sys.getenv()
FALSE invisibly with a warning if a proxy configuration was already set. You need
to unset the configuration with unset_proxy() before setting a new one.
The proxy is set using environment variables
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
The lower case version are also set because some utilities do not understand
upper case environment variable.
This configuration is used by curl for internet connection and other
method. See Setting Proxies in utils::download.file()
## Not run: set_proxy(proxy = "http://10.132.23.444:3232", username = "", password = "", noproxy = ".mycompany.com", https = TRUE) is_proxy_activated(verbose = TRUE) ## End(Not run)## Not run: set_proxy(proxy = "http://10.132.23.444:3232", username = "", password = "", noproxy = ".mycompany.com", https = TRUE) is_proxy_activated(verbose = TRUE) ## End(Not run)
This fonction is a helper to unset all configuration of proxy for the current session.
unset_proxy(verbose = FALSE)unset_proxy(verbose = FALSE)
verbose |
default is |
FALSE is no proxy configuration was set before. TRUE if
configuration is unset with success.
## Not run: set_proxy(proxy = "http://10.132.23.444:3232", username = "", password = "", noproxy = ".mycompany.com", https = TRUE) is_proxy_activated(verbose = TRUE) unset_proxy(verbose = TRUE) is_proxy_activated(verbose = TRUE) ## End(Not run)## Not run: set_proxy(proxy = "http://10.132.23.444:3232", username = "", password = "", noproxy = ".mycompany.com", https = TRUE) is_proxy_activated(verbose = TRUE) unset_proxy(verbose = TRUE) is_proxy_activated(verbose = TRUE) ## End(Not run)