Reputation: 145
I'm using the RSelenium package to connect to firefox, but I wish to do it via a socks proxy.
In Python, this is achievable using the webdriver package and setting the preferences of the FirefoxProfile, e.g.
profile=webdriver.FirefoxProfile()
profile.set_preference('network.proxy.socks', x.x.x.x)
profile.set_preference('network.proxy.socks_port', ****)
browser=webdriver.Firefox(profile)
However, I can't find how to try set the proxy to be a socks proxy, or to set the socks port in RSelenium. I've tried setting it using the RCurl options, as follows
options(RCurlOptions = list(proxy = "socks5h://x.x.x.x:****"))
but this gives me the following error message
Error in function (type, msg, asError = TRUE) :
Can't complete SOCKS5 connection to 0.0.0.0:0. (1)
Has anyone successfully connected to Firefox using a socks proxy using R code?
I am using version 1.3.5 of RSelenium and version 28.0 of Firefox.
Upvotes: 2
Views: 1373
Reputation: 30425
Not tested but something like the following should work:
fprof <- makeFirefoxProfile(list(
"network.proxy.socks" = "squid.home-server"
, "network.proxy.socks_port" = 3128L
, "network.proxy.type" = 1L
)
)
remDr <- remoteDriver(extraCapabilities = fprof)
remDr$open()
Upvotes: 1