Sets the proxy configuration for use with httr

httr_proxy(proxy, cert_file = NULL)

Arguments

proxy
An object of class "proxy". A proxy object see proxy.
cert_file
An SSL certification file. If NULL bmproxy will use the certificate file bundled with BrowserMob Proxy. For details see https://github.com/lightbody/browsermob-proxy/blob/master/mitm/README.md

Value

Returns a httr config object see config. This config contains the url and port of the proxy together with the appropriate certificate file.

Examples

## Not run: ------------------------------------ # prxy <- proxy(bmpPort = 9090L, port = 39500L) # # create a HAR # prxy %>% createHAR(ref = "httr_traffic") # rproj <- GET("https://www.r-project.org/", httr_proxy(prxy)) # httr_har <- prxy %>% getHAR() # httr_har[["log"]][["entries"]][[1]]["request"] # httr_har[["log"]][["entries"]][[1]]["response"] # prxy %>% closeProxy ## ---------------------------------------------