3

I want to change my system's ip through R , is there any way this can be done ? have tried below answer by Pablo Barbera but couldn't actually worked .

library(RCurl)
# check current IP address
print(getURL("http://ifconfig.me/ip"))
# proxy options
opts <- list(proxy="127.0.0.1", proxyport=8118)
# opening connection with TOR
con <- socketConnection(host="127.0.0.1",port=9051)
print(getURL("http://ifconfig.me/ip", .opts = opts))  

for (i in 1:10)
    {
    writeLines('AUTHENTICATE \"password\"\r\nSIGNAL NEWNYM\r\n', con=con)
    Sys.sleep(5)
    print(getURL("http://ifconfig.me/ip", .opts = opts)) 
    Sys.sleep(5)
    } 

LINK : Changing Tor identity in R

Can anybody make me understand what this code is saying and how this is wroking ?

Community
  • 1
  • 1
Pankaj Kaundal
  • 1,012
  • 3
  • 13
  • 25

0 Answers0