Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

nitpicky cleanup

  • Loading branch information...
commit 0a9ab096175cad784bfc93bbe6698fadf7f30bf9 1 parent ad9104f
Andrew Fleenor authored
Showing with 4 additions and 10 deletions.
  1. +1 −1  .gitignore
  2. +0 −1  http/response.py
  3. +1 −1  httpsession.py
  4. +2 −7 main.py
View
2  .gitignore
@@ -1,3 +1,3 @@
.gitignore
*.pyc
-
+pcap2har.log
View
1  http/response.py
@@ -1,7 +1,6 @@
import gzip
import zlib
import cStringIO
-#import dpkt.http this is buggy
import dpkt_http_replacement as dpkt_http
import http
from mediatype import MediaType
View
2  httpsession.py
@@ -167,7 +167,7 @@ def json_repr(self):
'pageTimings': PageTracker.default_page_timings
} for page_str, page_ref, start_time, title in srt]
-class HTTPSession(object):
+class HttpSession(object):
'''
Represents all http traffic from within a pcap.
View
9 main.py
@@ -39,16 +39,11 @@
pcap.ParsePcap(dispatcher, filename=inputfile)
dispatcher.finish()
-dns = dispatcher.udp.dns
-for q in dns.queries.itervalues():
- print '(%d) %s' % (dns.num_queries(q.name), q.name), '\tduration:', dns.get_resolution_time(q.name)
-
# parse HAR stuff
-session = httpsession.HTTPSession(dispatcher)
+session = httpsession.HttpSession(dispatcher)
logging.info("Flows=%d. HTTP pairs=%d" % (len(session.flows),len(session.entries)))
+#write the HAR file
with open(outputfile, 'w') as f:
json.dump(session, f, cls=har.JsonReprEncoder, indent=2, encoding='utf8')
-
-pass
Please sign in to comment.
Something went wrong with that request. Please try again.