Scope:
I am trying to get all my HttpRequests issued via C# to get routed through the TOR Network.
After some quick research I've found some stack overflow questions like This One and This One, so i followed their examples and tried it myself.
Code Sample:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
"http://whatismyipaddress.com/"
);
request.Proxy = new WebProxy("127.0.0.1:8118");
using (var response = request.GetResponse())
{
using (var reader = new StreamReader(
response.GetResponseStream(),
Encoding.GetEncoding("utf-8")
))
{
string resp = reader.ReadToEnd();
}
}
Results:
I have Privoxy installed and running (netstat -b -a
shows it is running/listening on the port 8118).
The Request is not logged onto the Privoxy client, although it seems like it is working.
The Problem:
As the user @Junior Mayhé have pointed out, i have to uncomment this line on the privoxy config file
forward-socks5 / 127.0.0.1:9050
After doing so, my web requests start to get Error 503 - Server Unavailable
.
I have tried starting the Tor Browser but it still raises me this error.
What am i doing wrong?
Edit One:
After playing a bit with Netstat -b -a
seems like Firefox's Tor is actually running on Port:9151
instead of Port:9050
as stated by these older questions.
After changing the port number on the Privoxy config file to 9151 i no longer get the Server Unavailable error, instead i get a Operation TimedOut. I already increased the value of the request timeout (both connection timeout and readwrite timeout) to 2 minutes and i still get this error.