3

I am calling Tor using the following code:

IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9150);
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(endPoint);
socket.Send(Encoding.ASCII.GetBytes("GET / HTTP/1.1\r\nHost: www.mentalis.org\r\n\r\n"));

byte[] receivedData = new byte[socket.ReceiveBufferSize];
int receivedDataLength = socket.Receive(receivedData);
string stringData = Encoding.ASCII.GetString(receivedData, 0, receivedDataLength);

but the server responds

the tor is not http proxy.

Can anyone tell me what could be the problem and how to resolve it?

Vojtěch Dohnal
  • 7,867
  • 3
  • 43
  • 105
l.m
  • 31
  • 1

0 Answers0