<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Joe!<div class=""><br class=""></div><div class="">You can have a look here: <a href="https://github.com/tonyrog/eth" class="">https://github.com/tonyrog/eth</a></div><div class=""><br class=""></div><div class="">I wrote a cookie state tracker by just inspecting the HTTP/TCP packet traffic.</div><div class="">This is an example program using ’eth’ in src/eth_http_track.erl</div><div class=""><br class=""></div><div class="">Maybe you can find something useful there.</div><div class=""><br class=""></div><div class="">I guess you can estimate the data up/down loaded by calculate sum over packets data length,</div><div class="">(ignoring retransmission etc) and/or check the Content-Length where possible.</div><div class=""><br class=""></div><div class="">I think you may use enet/src/enet_tcp_fsm.erl  to collect the stream, not sure what happens if you </div><div class="">miss a packet or two?</div><div class=""><br class=""></div><div class="">/Tony</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 1 sep 2015, at 09:54, Joe Armstrong <<a href="mailto:erlang@gmail.com" class="">erlang@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hello,<br class=""><br class="">I want to record all traffic between my browser and the Internet.<br class=""><br class="">What I want is a record of<br class=""><br class="">    1) the request<br class="">    2) the number of bytes in the response<br class="">    3) some timing data<br class=""><br class="">When I fetch a web page.<br class=""><br class="">I'd like this data (if possible) in the form of event messages being sent<br class="">to an Erlang program.<br class=""><br class="">Why do I want this?<br class=""><br class="">I was horrified by reading<br class=""><a href="http://blog.lmorchard.com/2015/07/22/the-verge-web-sucks/" class="">http://blog.lmorchard.com/2015/07/22/the-verge-web-sucks/</a><br class="">and wanted to accurately record exactly how much data is involved when<br class="">I request a web page. The I want see how much is content and how much<br class="">is crap.<br class=""><br class="">Any ideas<br class=""><br class="">/Joe<br class="">_______________________________________________<br class="">erlang-questions mailing list<br class="">erlang-questions@erlang.org<br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""></div></body></html>