I'm working on a proxy and i was wondering how i can collect the cookies and pass them back to the client? so they can log into sites and etc? here is my http receive code and pass the info back:
how can i gather the cookies and pass them back?
-Thanks
C#.Net3.5
Code:
System.Net.Configuration.HttpWebRequestElement wr = new System.Net.Configuration.HttpWebRequestElement();
wr.UseUnsafeHeaderParsing = true;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
CookieContainer cookieContainer = new CookieContainer();
request.CookieContainer = cookieContainer;
request.CookieContainer.Add(cookieContainer.GetCookies((Uri)url));
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responsestream = response.GetResponseStream();
byte[] buffer = new byte[bz];
rebu = responsestream.Read(buffer, 0, bz);
while (rebu != 0)
{
soket.Send(buffer, rebu, 0);
rebu = responsestream.Read(buffer, 0, bz);
}
-Thanks
C#.Net3.5
Comment