{"id":16411782,"url":"https://github.com/ijlyttle/rproxy","last_synced_at":"2026-05-13T01:34:50.390Z","repository":{"id":54545010,"uuid":"336638134","full_name":"ijlyttle/rproxy","owner":"ijlyttle","description":"Help Setting Proxy Environment-Variables","archived":false,"fork":false,"pushed_at":"2021-02-11T15:33:37.000Z","size":57,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-31T16:48:11.978Z","etag":null,"topics":[],"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/ijlyttle.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-06T21:15:55.000Z","updated_at":"2025-11-10T05:02:19.000Z","dependencies_parsed_at":"2022-08-13T19:10:59.759Z","dependency_job_id":null,"html_url":"https://github.com/ijlyttle/rproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ijlyttle/rproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Frproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Frproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Frproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Frproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijlyttle","download_url":"https://codeload.github.com/ijlyttle/rproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Frproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32964052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-11T06:46:34.113Z","updated_at":"2026-05-13T01:34:50.368Z","avatar_url":"https://github.com/ijlyttle.png","language":"R","funding_links":[],"categories":[],"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, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# rproxy\n\n\u003c!-- badges: start --\u003e\n\n[![CRAN status](https://www.r-pkg.org/badges/version/rproxy)](https://CRAN.R-project.org/package=rproxy) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) [![R-CMD-check](https://github.com/ijlyttle/rproxy/workflows/R-CMD-check/badge.svg)](https://github.com/ijlyttle/rproxy/actions)\n\n\u003c!-- badges: end --\u003e\n\nThe goal of rproxy is to help you set proxy variables in situations that do not follow the [cURL](https://curl.se/) convention. Personal note: I was sorely tempted to name this package proxymusic.\n\nIf you use a proxy, you are likely familiar with setting this combination of environment variables used by cURL:\n\n    http_proxy=http://proxy.acme.com\n    https_proxy=http://proxy.acme.com\n    HTTP_PROXY=http://proxy.acme.com\n    HTTPS_PROXY=http://proxy.acme.com\n    no_proxy=127.0.0.1,localhost,github.acme.com\n\nYou will note the repetition of values proxy environment variables. I have never seen them differ within the pattern, but I have worked for only one company.\n\nWhen it makes an http(s) connection, a system library will often use this combination of variables to decide it it needs to use the proxy. If your system library uses cURL, things will *just work*. If they don't, then you may need to get creative. This is where this package may help.\n\n## Installation\n\nYou can install development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"ijlyttle/rproxy\")\n```\n\n## Usage\n\nThere are three sets of functions in this package.\n\nYou can determine your current proxy and no-proxy environment-variables:\n\n```{r setvars, echo=FALSE, message=FALSE}\nproxy \u003c- rproxy::envvar_proxy()\nno_proxy \u003c- rproxy::envvar_no_proxy()\n  \nSys.setenv(\n  http_proxy = \"http://proxy.acme.com\",\n  https_proxy = \"http://proxy.acme.com\",\n  HTTP_PROXY = \"http://proxy.acme.com\",\n  HTTPS_PROXY = \"http://proxy.acme.com\",\n  no_proxy = \"127.0.0.1,localhost,github.acme.com\"  \n)\n```\n\n```{r}\nlibrary(\"rproxy\")\nenvvar_proxy()\n```\n\n```{r}\nenvvar_no_proxy()\n```\n\nYou can determine if you need to use the proxy for a given `url`. These functions can be useful if your system library does not use the cURL convention and you need to provide a value for the proxy.\n\n```{r}\nuses_proxy(\"https://github.com/\")\n```\n\n```{r}\nget_proxy(\"https://github.com/\")\n```\n\nYou can also set the value of the proxy environment-variables temporarily. This may be useful for situations where the system library recognizes the proxy environment-variable, but no the no-proxy environment variable.\n\nYou can insist that the proxy not be used - this could be useful for interactive work:\n\n```{r}\nwithout_proxy(\n  envvar_proxy() \n)\n```\n\nYou can also *temporarily* set the proxy environment-variable for a `url` by applying the no-proxy environment-variable using R rather than the system library. These functions use the amazing [withr](https://withr.r-lib.org/)\npackage.\n\nYou can use `with_proxy_for_url()` to set the proxy environment-variable only for the scope of the call; outside the call, nothing has changed:\n\n```{r}\nwith_proxy_for_url(\n  \"localhost\",\n  envvar_proxy() \n)\n```\n\n```{r}\nenvvar_proxy() \n```\n\nTo set the proxy environment-variable within the scope of a function you provide, `local_proxy_for_url()` can be useful:\n\n```{r}\nnew_envvar_proxy \u003c- function(url) {\n  rproxy::local_proxy_for_url(\"localhost\")\n  rproxy::envvar_proxy()\n}\n\nnew_envvar_proxy()\n```\n\n```{r}\nenvvar_proxy() \n```\n\n```{r insetvars, echo=FALSE, message=FALSE}\nSys.setenv(\n  http_proxy = proxy,\n  https_proxy = proxy,\n  HTTP_PROXY = proxy,\n  HTTPS_PROXY = proxy,\n  no_proxy = no_proxy \n)\n```\n\n## Code of Conduct\n\nPlease note that the rproxy project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlyttle%2Frproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijlyttle%2Frproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlyttle%2Frproxy/lists"}