title: How to capture packets in localhost between two ports
body: <p>I have two applications communicating on same machine (localhost) using socket. If application are on different machine I can use Wireshark. But how to capture packets on same machine. </p>
  
  <p>I do not know on which port number application are communicating. Because I am using library calls and do not know lower level details.</p>
  
  <p>We are having our application on Ubuntu and Windows XP.</p>