Hacker News new | ask | show | jobs
by mutairibassam 640 days ago
I agree with you, currently I am only catching the request that have valid http method. I mentioned this in code comments there is todo task to capture different cases as well.

Moreover, I am happy to learn more from you and if you have any recommendation please mention it. This simple implementation has met my needs.

Regarding the performance, to be honest I've not tested it as I am not expert in this domain, so any hit is appreciated.

1 comments

It would be better to stream the captured packets to a proper HTTP parser. That way you can also handle HTTP keepalive.

Also, you can set a filter on the pcap session so that pcap only gives you http packets. Then you don't have to check yourself whether you captured non-http.