0

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);
        webClient.Dispose();
    }
0

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("127.0.0.1:8118");
client.Proxy = wp;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.