Skip to content

Instantly share code, notes, and snippets.

View tuhulab's full-sized avatar

Tu Hu tuhulab

View GitHub Profile
@jeroen
jeroen / tor.R
Last active January 30, 2024 20:45
Using TOR in R
# Installing TOR on mac: brew install tor
# Run TOR on custom port: tor --SOCKSPort 9050
# Check the 'origin' field in the response to verify TOR is working.
library(httr)
GET("https://httpbin.org/get", use_proxy("socks5://localhost:9050"))
# Set proxy in curl
library(curl)
h <- new_handle(proxy = "socks5://localhost:9050")