There is a task to write a simple browser that would download the html code of any page from the Internet, but at the same time you need to implement a connection to the proxy with a login and password and without it. Tried to make a CONNECT request through a socket, but the server does not respond. How to connect to a free proxy in this way?
Class proxy { Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); int port = 1234; // тут порт прокси IPEndPoint ipPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0", port);//тут ип socket.Bind(ipPoint); socket.Send(Encoding.GetBytes("CONNECT 0.0.0.0:1234 HTTP/1.1") byte[] buffer = new buffer[9990] socket.Receive(buffer); }