을 개발하면 코드 조각은 다음과 같습니다. static void Main (string [] args) { string host = "www.google.com"; int proxyPort = 443; // 443; I 코드를 실행할 때오픈 소스 프록시 스크립트를 개발할 때 프록시 스크립트
byte[] buffer = new byte[2048];
int bytes;
// Connect socket
TcpClient client = new TcpClient(host, proxyPort);
NetworkStream stream = client.GetStream();
byte[] tunnelRequest = Encoding.UTF8.GetBytes(String.Format("CONNECT www.google.com:443 HTTP/1.1\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; rv:23.0) Gecko/20100101 Firefox/23.0\r\nProxy-Connection: keep-alive\r\nConnection: keep-alive\r\nHost: www.google.com\r\n\r\n", host));
stream.Write(tunnelRequest, 0, tunnelRequest.Length);
stream.Flush();
SslStream sslStream = new SslStream(stream);
sslStream.AuthenticateAsClient(host);
}
이 선에 에러가 발생 : sslStream.AuthenticateAsClient (호스트); 오류 설명 : 전송 연결에서 데이터를 읽을 수 없습니다. 기존 연결이 원격 호스트에 의해 강제로 닫혔습니다. 또는이 오류 : 원격 파티가 전송 스트림을 닫았으므로 Autentication이 실패했습니다. 제발 도와주세요 감사합니다
~ 20k 줄의 코드를 직접 작성하는 대신 FiddlerCore (http://fiddler2.com/core/)를 사용하지 않는 이유는 무엇입니까? – EricLaw