Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET HTTP parser

I am writing an application to sniff some HTTP traffic. I am using WinPcap to access the TCP/IP packets. Is there a library that will help me parse the HTTP messages?

I have implemented a basic parser myself, but I would like something more mature: I keep running into new variations (chunked messages, gzip-compression etc.)

The .NET framework probably have a HTTP parser, but I can't see any way to use it, when the TCP packets do not come from a direct TCP connection.

like image 909
Rasmus Faber Avatar asked Apr 13 '09 12:04

Rasmus Faber


2 Answers

Check out HttpMachine | https://github.com/bvanderveen/httpmachine

like image 130
gsscoder Avatar answered Oct 26 '22 20:10

gsscoder


You could create a dummy "http server" and serve your sniffed packets out of it, then you can use .NET's parser (HttpWebResponse or whatever).

like image 45
Anton Tykhyy Avatar answered Oct 26 '22 20:10

Anton Tykhyy