title: How to read raw data sent to a port (python)
body: <p>I just want to intercept raw data (hex)--headers and all--sent to a port, and relay them over an xmpp server. Then I would like to be able to replay to the port with hex I receive in a similar manner.</p>
  
  <p>I tried raw sockets, as described <a href="http://forums.freebsd.org/showthread.php?t=11513" rel="nofollow">here</a>, and got the same error. I am not sure how to use pcap (the one for python) to do this.</p>