Hi there
i m making a simple proxy server, implementing a GET
method, but for somehow, the page seem to be never finish
loading. (even loading a simple plain text)
the following is my code..
string sURL = path; //the url
WebRequest webrequest = WebRequest.Crea te(sURL);
StreamReader objReader = new StreamReader
(webrequest.Get Response().GetR esponseStream() ,
Encoding.ASCII) ;
string sLine = "";
while (sLine!=null)
{
sLine = objReader.ReadL ine();
if (sLine!=null)
{
handler.Send(Sy stem.Text.Encod ing.ASCII.GetBy tes
(sLine));
handler.Send(da taMsg); //handler is a Socket
}
}
objReader.Close ();
handler.Shutdow n(SocketShutdow n.Both);
handler.Close() ;
}
i m making a simple proxy server, implementing a GET
method, but for somehow, the page seem to be never finish
loading. (even loading a simple plain text)
the following is my code..
string sURL = path; //the url
WebRequest webrequest = WebRequest.Crea te(sURL);
StreamReader objReader = new StreamReader
(webrequest.Get Response().GetR esponseStream() ,
Encoding.ASCII) ;
string sLine = "";
while (sLine!=null)
{
sLine = objReader.ReadL ine();
if (sLine!=null)
{
handler.Send(Sy stem.Text.Encod ing.ASCII.GetBy tes
(sLine));
handler.Send(da taMsg); //handler is a Socket
}
}
objReader.Close ();
handler.Shutdow n(SocketShutdow n.Both);
handler.Close() ;
}