How to detect which TCP packets are part of a HTTP connection in C#? [duplicate]
I am working on url tracker project where I have to track all sites visited by a user. So I deci开发者_如何学运维ded to do it by tracking TCP packets on every user request. So I am capturing all the TCP packets user requesting. But how can I figure out if it is a normal TCP request or HTTP request. Any suggestion will be very helpful. Thanks.
I would suggest that running an HTTP proxy would be a better way of doing this. That way the browser (or anything else wanting to make HTTP requests) will know to use your application, and other applications won't be affected.
You would have to inspect the request for a HTTP message such as GET /images/logo.png HTTP/1.1
, and then you need to observe a response to make sure it actually succeeded.
精彩评论