title: Packet Sniffing using Raw Sockets in Linux in C
body: <p>I need to write a packet sniffer in Linux that detects HTTPS packet that are sent and save the url from the request. I found code for this in <a href="http://www.security-freak.net/raw-sockets/raw-sockets.html" rel="nofollow noreferrer">security-freak</a> and ran it. This code runs and only sniffs the received packet but I need to get the sent packet in the sniffer.
  How do I get the sent packet in this code?</p>
  
  <p>I can't use any library like libcap (forbidden).
  The code is :<a href="http://sjb.ir/sniffer.c" rel="nofollow noreferrer">sniffer.c</a></p>