There is a lot of talk about the poor old ESP32 chip not being able to handle TOR due to its resource constraints, and I know there is one library out there that might work if I had platform.io and vscode... but I have neither - I'm an Arduino IDE guy - and the briand-toresp32 is too big for me to work on.
All of that said, there is also a lot of code out there to turn an ESP32 INTO a socks proxy... but very little I can find (actually zero - hence this post) about how to connect the ESP32 TO a SOCKS proxy, which would seem like the perfect option (for an ESP32/8266 anyway).
If you use the WIFIClient.connect() method to connect to a SOCKS proxy then send the full URL into the GET/POST string, that seems to make the proxy think you want it to be an HTTP proxy... my SOCKS proxy doesn't like that.
Using a SOCKS proxy in PHP (using CURL) is easy, just needing to add 2 curl_setopt()
lines:
$ch = curl_init ( "http://myserver.onion");
curl_setopt ( $ch, CURLOPT_PROXY, "10.10.1.1:9050" );
curl_setopt ( $ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME );
...
Doing it in Python (using the requests package) is even easier (and that's saying something coming from me) just setting up a proxies
object:
proxies = { "http": "socks5h://10.10.1.1:9050" }
response = requests.post("http://myserver.onion", data=payload, headers=headers, proxies=proxies)
Does anyone know of a class that will handle the SOCKS stuff for me, or a really simple explanation of what I need to do to write my own or one that is almost there, that I can try and port into the Arduino IDE?