hi, I am capturing http transactions by using Net::PcapUtils module. I want to do real time processing on the captured packets. Following is a snippet of data that I am getting:
POST /vodexUi/CVodSchedularViewMgr .php HTTP/1.0^M Host: 192.168.1.157^M User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4^M Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 ,text/plain;q=0.8,image/png,*/*;q=0.5^M Accept-Language: en-us,en;q=0.5^M Accept-Encoding: gzip,deflate^M Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7^M Keep-Alive: 300^M Referer: http://192.168.1.157/vodexUi/CVodSchedularViewMgr.php^M<http://192.168.1.157/vodexUi/CVodSchedularViewMgr.php%5EM> Content-Type: application/x-www-form-urlencoded^M Content-Length: 445^M Via: 1.1 STLBSERVEROO1L.SUBEXTECH.COM:3128<http://stlbserveroo1l.subextech.com:3128/>(squid/2.5.STABLE5)^M X-Forwarded-For: 192.168.1.157^M Cache-Control: max-age=259200^M Connection: keep-alive^M ^M strPageOp=loadDetails&strUnicastUrl=&strCPNoOfVusUNI=&strCPLoopUNI=&strVlanUNI=UcastVlan&vUcastDurationHour=&vUcastDurationM HTTP/1.1 200 OK^M Date: Thu, 26 Oct 2006 09:28:12 GMT^M Server: Apache/2.0.54 (Fedora)^M X-Powered-By: PHP/5.0.4^M Expires: Mon, 26 Jul 1997 05:00:00 GMT^M Last-Modified: Thu, 26 Oct 2006 09:28:12 GMT^M Cache-Control: no-store, no-cache, must-revalidate^M Cache-Control: post-check=0, pre-check=0^M Pragma: no-cache^M Connection: close^M Content-Type: text/html; charset=UTF-8^M ^M I am not writing this data to a file. So from console, I want to read the data line by line and extract some info like method(POST/GET), host, POST body, response, etc. Can anybody please suggest how I can achieve this?? Also the post body may be different for different packets(like here it is strPageOp=loadDetails&..........). How do I retrieve post body in that case?? I shall be grateful for your quick responses.. thanks, Mihir