Ok, if I have this right, my code can get cookies at a specific url, but then once I get the cookie, into the container, how can I send it to the client via socket? Like the code directly below does here for regular http-page requests.
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);
}
My code section for requests/responses
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);
}
This is part of a proxy server I'm coding and I'm having trouble with cookies.
C#.net3.5