Description Usage Arguments Value See Also Examples
Gets a list of URL patterns from the whitelist
1 |
proxy |
An object of class "proxy". A proxy object see
|
... |
Additonal function arguments |
Returns a list. Each item of the list is a regex from the white list
Other bwlist functions: addURLBlackList
,
clearBlackList
,
clearWhiteList
, getBlackList
,
setWhiteList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | ## Not run:
# A BMP server is assummed running on port 9090
prxy <- proxy(bmpPort = 9090L, port = 39500L)
library(httr)
# use httr_proxy to configure proxy for httr
white_list <- prxy %>% getWhiteList
white_list
# set an entry in the white list
prxy %>% setWhiteList(".*r-project\\.org.*", statusCode = 333L)
white_list <- prxy %>% getWhiteList
white_list
# expect passing sites
rcran <- GET("https://cran.r-project.org/", httr_proxy(prxy))
rproj <- GET("https://www.r-project.org/", httr_proxy(prxy))
# expect 333 status code for non matching url
goog <- GET("https://www.google.com/", httr_proxy(prxy))
goog$status_code
# clear the white list
white_list <- prxy %>%
clearWhiteList %>%
getWhiteList
length(white_list)
# get the black list
black_list <- prxy %>% getBlackList
black_list
# add site to black list
prxy %>% addURLBlackList(".*r-project\\.org.*", statusCode = 334L)
goog <- GET("https://www.google.com/", httr_proxy(prxy))
# expect sites to return 334 status code
rcran <- GET("https://cran.r-project.org/", httr_proxy(prxy))
rproj <- GET("https://www.r-project.org/", httr_proxy(prxy))
rcran$status_code
rproj$status_code
# clear black list
black_list <- prxy %>%
clearBlackList %>%
getBlackList
length(black_list)
prxy %>% closeProxy
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.