1

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.

Community
  • 1
  • 1
Marcello Grechi Lins
  • 3,350
  • 8
  • 38
  • 72
  • 1
    I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Feb 23 '14 at 01:21
  • and you've edited it to have the tor tag in the title – puser Apr 24 '14 at 11:03

2 Answers2

0

Maybe missing a period? That's what I have in my config file.

forward-socks5   /               127.0.0.1:9050 .
0

Use this port: 9150 in privoxy settings. Worked for me

John
  • 1