I have this code that will communicate with a server to send a data, I want it to send the data through TOR .I heard it uses the SOCKS protocol, So how can I use my client app to communicate over TOR with my server.Here is my code that sends data over regular HTTP protocol

  public void sendKey()
        string url="http://localhost:8731/savekey.aspx";
        WebClient webClient = new WebClient();
        NameValueCollection formData = new NameValueCollection();            
        formData["clientpassword"] = encryptedPassword;
        byte[] responseBytes = webClient.UploadValues(url,"POST",formData);

1 Answer 1


You'll need to add a proxy in there somehow.

The classes you're using don't support SOCKS proxying.

One way to get around this would be to use Privoxy, then proxy using the appropriate port. The (simplified) pertinent code then becomes:

WebClient client = new WebClient();
WebProxy wp = new WebProxy("");
client.Proxy = wp;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .