title: How to create a simple proxy in C#?
body: <p>I have downloaded Privoxy few weeks ago and for the fun I was curious to know how a simple version of it can be done.</p>
  <p>I understand that I need to configure the browser (client) to send request to the proxy. The proxy send the request to the web (let say it's a http proxy). The proxy will receive the answer... but how can the proxy send back the request to the browser (client)?</p>
  <p>I have search on the web for C# and http proxy but haven't found something that let me understand how it works behind the scene correctly. (I believe I do not want a reverse proxy but I am not sure).</p>
  <p>Does any of you have some explication or some information that will let me continue this small project?</p>
  <h2>Update</h2>
  <p>This is what I understand (see graphic below).</p>
  <p><strong>Step 1</strong> I configure the client (browser) for all request to be send to 127.0.0.1 at the port the Proxy listen. This way, request will be not sent to the Internet directly but will be processed by the proxy.</p>
  <p><strong>Step2</strong> The proxy see a new connection, read the HTTP header and see the request he must executes. He executes the request.</p>
  <p><strong>Step3</strong> The proxy receive an answer from the request. Now he must send the answer from the web to the client but how???</p>
  <p><img src="https://i.stack.imgur.com/zNWDc.png" alt="alt text" /></p>
  <h3>Useful link</h3>
  <p><a href="http://www.mentalis.org/soft/projects/proxy/" rel="noreferrer">Mentalis Proxy</a> : I have found this project that is a proxy (but more that I would like). I might check the source but I really wanted something basic to understand more the concept.</p>
  <p><a href="http://www.codeproject.com/KB/aspnet/asproxy.aspx" rel="noreferrer">ASP Proxy</a> : I might be able to get some information over here too.</p>
  <p><a href="http://bartdesmet.net/blogs/bart/archive/2007/02/22/httplistener-for-dummies-a-simple-http-request-reflector.aspx" rel="noreferrer">Request reflector</a> : This is a simple example.</p>
  <p>Here is a <a href="https://github.com/MrDesjardins/SimpleHttpProxy" rel="noreferrer">Git Hub Repository with a Simple Http Proxy</a>.</p>