httr_proxy: Set httr proxy configuration

Description Usage Arguments Value Examples

Description

Sets the proxy configuration for use with httr

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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

## End(Not run)

johndharrison/bmproxy documentation built on May 19, 2019, 5:13 p.m.