title: Creating an effective packet sniffer in .NET
body: <p>I'm looking to create what I call a proxy, although that definition is probably somewhat inaccurate.</p>
  
  <p>Typically, you have something like this:</p>
  
  <pre><code>Client --------- Server
  </code></pre>
  
  <p>What I want to do is introduce a proxy, without a new layer, like this:</p>
  
  <pre><code>Client ----+---- Server
             |
           Proxy
  </code></pre>
  
  <p>I do not want this:</p>
  
  <pre><code>Client---Proxy---Server
  </code></pre>
  
  <p>I understand that WinPCap does something similar to this, but it's an under documented subject as far as I can see.</p>
  
  <p>So far I've tried a few things, most notably listening on the same port as the client for messages. This resulted in little more than receiving a load of crap packets from random applications (in spite of listening on a specific port). I couldn't find a lot to suggest I was reading the correct data, although I believe I have found that now, after making some minor modifications.</p>
  
  <p>Does anyone know of any reason against using this method? Or is there some more sustainable way of doing it?</p>