{"id":14068169,"url":"https://github.com/cderv/proxyconfig","last_synced_at":"2025-10-06T23:12:30.024Z","repository":{"id":78261857,"uuid":"128679659","full_name":"cderv/proxyconfig","owner":"cderv","description":"Tools to Configure Proxy Interactively","archived":false,"fork":false,"pushed_at":"2019-10-06T17:41:03.000Z","size":54,"stargazers_count":16,"open_issues_count":11,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-23T06:34:54.347Z","etag":null,"topics":["proxy-configuration","r"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cderv.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-08T20:33:20.000Z","updated_at":"2024-12-10T18:01:53.000Z","dependencies_parsed_at":"2023-03-12T03:53:58.433Z","dependency_job_id":null,"html_url":"https://github.com/cderv/proxyconfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cderv/proxyconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cderv%2Fproxyconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cderv%2Fproxyconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cderv%2Fproxyconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cderv%2Fproxyconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cderv","download_url":"https://codeload.github.com/cderv/proxyconfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cderv%2Fproxyconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278693065,"owners_count":26029429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["proxy-configuration","r"],"created_at":"2024-08-13T07:05:59.955Z","updated_at":"2025-10-06T23:12:29.973Z","avatar_url":"https://github.com/cderv.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\",\n  eval = FALSE\n)\n```\n# proxyconfig\n\n\u003c!-- badges: start --\u003e\n[![Azure pipelines build status](https://img.shields.io/azure-devops/build/cderv/proxyconfig/1)](https://dev.azure.com/cderv/proxyconfig/_build/latest?definitionId=1\u0026branchName=master)\n[![Azure pipelines test status](https://img.shields.io/azure-devops/tests/cderv/proxyconfig/1?color=brightgreen\u0026compact_message)](https://dev.azure.com/cderv/proxyconfig/_build/latest?definitionId=1\u0026branchName=master)\n[![Azure pipelines coverage status](https://img.shields.io/azure-devops/coverage/cderv/proxyconfig/1)](https://dev.azure.com/cderv/proxyconfig/_build/latest?definitionId=1\u0026branchName=master)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/proxyconfig)](https://CRAN.R-project.org/package=proxyconfig)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)\n[![Travis build status](https://travis-ci.com/cderv/proxyconfig.svg?branch=master)](https://travis-ci.com/cderv/proxyconfig)\n[![Codecov test coverage](https://codecov.io/gh/cderv/proxyconfig/branch/master/graph/badge.svg)](https://codecov.io/gh/cderv/proxyconfig?branch=master)\n\u003c!-- badges: end --\u003e\n\nThe goal of proxyconfig is to help setting the proxy interactively.  \n\n## About proxy configuration\n\n### Why would you need to configure a proxy ? \n\nIn a corporate environment, there is often a proxy you need to pass through to\nescape your company network. When behind this firewall of your company, you need\nto first tell R that it needs to pass the proxy before trying to reach the url\nand not to use it when the url you want to access are inside the same network.\n\n### Examples of when it is needed\n\nFor example, behind a company proxy, \n\n+ `install.package` won't be able to reach a cran mirror that is outside like `https://https://cloud.r-project.org/`\n+ `download.file` won't be able to get a file from a url\n+ `httr::GET`, `curl::curl` won't be able to be used for web url.\n\nThe first two are R base features and have a `method` argument that you can use to help configure correctly. Different methods can have different settings. The most used is _libcurl_ that is also used by `httr` and `curl` :package:.\n\n### Some words about proxy configuration in R\n\nSometimes, proxy is automatically picked up by R. It is the case on windows\nwhere R uses the _wininet_ method by default, for which the 'Internet Options',\nfrom Internet Explorer or Edge, are used for proxy configuration.\nOn other system, proxy must often be explicity configured. \n\nYou'll find information about _Setting Proxies_ in R in the `utils::download.file()` help page:\n`help(\"download.file\", package = \"utils\")` or `?download.file`.\n\n\n## Installation\n\nCurrently, this package is only available on Github in development version :\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"cderv/proxyconfig\")\n```\n\nor using\n\n```r\nsource(\"https://install-github.me/cderv/proxyconfig\")\n```\n\n## How to use `proxyconfig`\n\n### How to set the proxy\n\nGiven a proxy url, you can set the proxy interactively using `set_proxy` using `proxy` argument. Proxy\nurl must be of the form _scheme://hostname[:port]_.\n\n```{r set_proxy, eval = FALSE}\nproxyconfig::set_proxy(proxy = \"http://proxy.mycompany.com:3939\")\n```\n\nYou can also use `options(proxyconfig.proxy = \"http://proxy.mycompany.com:3939\")` \nso that it knows which url to use as default. You can use `usethis::edit_r_profile()` to open the user \n_.Rprofile_ and add the option.\n\nThen when in _.Rprofile_, you can call directly\n```{r eval = FALSE}\nproxyconfig::set_proxy()\n```\n\nBy default if username and password not provided, this will prompt the user for authentification. You can pass them in `set_proxy` argument too to use non-interactively. **This is not advice to pass them in clear in a script** - this is what the interactive mode with dialog box aims to prevent. \n\n\nIf you don't have any authentification for your proxy, use empty values explicitly.\n```{r set_proxy_without_auth, eval = FALSE}\nproxyconfig::set_proxy(proxy = \"http://proxy.mycompany.com:3939\", username = \"\", password = \"\")\n```\n\nTo prevent the proxy to be used for url on internal network domain, use `noproxy` argument. (empty by default). This useful for a github entreprise server or an internal cran repos for example, respectively on `https://github.mycompany.com` and `https://cran.mycompany.com`. Both are on the same domain - `noproxy` is configured here to look for url on domain mycompany.com without exiting the internal pany network through the proxy.\n\n```{r eval = FALSE}\nproxyconfig::set_proxy(proxy = \"http://proxy.mycompany.com:3939\", noproxy = \".mycompany.com\")\n```\n\nIf several domains (or IP addresses) are necessary, they will be concatenated properly. \n\n```{r eval = FALSE}\nproxyconfig::set_proxy(proxy = \"http://proxy.mycompany.com:3939\", noproxy = c(\".mycompany.com\", \"163.104.50.180\"))\n```\n\n\n```{r include = FALSE}\n# for readme demo - not an example to follow as password is in clear\nproxyconfig::set_proxy(proxy = \"http://proxy.mycompany.com:3939\", username = \"its\", password = \"me\", noproxy = c(\".mycompany.com\", \"163.104.50.180\"), https = TRUE)\n```\n\n### How to check what is configured ? \n\n`set_proxy()` will set the correct environment variable for the current session. You can verify if a proxy is currently configured with `is_proxy_activated()`\n\n```{r check-proxy, eval = FALSE}\nproxyconfig::is_proxy_activated()\n```\n\nYou can have more information using `verbose = TRUE`. (Note that authentification is hidden when printed)\n\n```{r check-proxy-verbose, eval = FALSE}\nproxyconfig::is_proxy_activated(TRUE)\n```\n\n### What if a proxy is already set ? \n\nIf a proxy is already set, `set_proxy` will issue a warning (and return false invisibly)\n```{r, eval = FALSE}\n(proxyconfig::set_proxy(proxy =  \"https://newproxy.company.com\"))\n```\n\nYou can unset a proxy configuration with `unset_proxy()`\n```{r, eval= FALSE}\nproxyconfig::unset_proxy(verbose = TRUE)\n# proxy is correctly deactivated\nproxyconfig::is_proxy_activated(TRUE)\n```\n\n\n# TODO\n\nThis is a very new package that works for me. Among the ideas I have for improvement\n\n - [ ] Use an option mechanism to make the proxy url persistent across sessions\n - [ ] Use [keyring](https://github.com/r-lib/keyring) to store and retrieve auth accross session\n - [ ] Make a templating system to use proxyconfig in an internal package. Inspiration `ghentr` and `pkgconfig`\n - [ ] Improve console output with `cli`\n - [ ] Create an add-on for better interactation (and keybinding)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcderv%2Fproxyconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcderv%2Fproxyconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcderv%2Fproxyconfig/lists"}