开发者

.NET: List HTTP traffic URLs with C#

开发者 https://www.devze.com 2023-02-25 01:30 出处:网络
I am looking for a basic method of retrieving the URLs (HTTP) being requested by any other application on the local computer. Basically I only want a textbox in this app that lists the URLs as they ar

I am looking for a basic method of retrieving the URLs (HTTP) being requested by any other application on the local computer. Basically I only want a textbox in this app that lists the URLs as they are being requested. I am only interested in the url, nothing more. What would be the simplest way of accomplishing this? I would rather not require the app to run in admin-mode and I don开发者_运维百科't want to use external libraries such as Fiddler or similar.

Update:

I noticed Fiddler was developed with .NET so its obviously possible to do what I want using only .NET. Im sifting through the code of Fiddler using Reflector but its not giving me much. I dont know where to start. But as I said, Im only interesting in outgoing traffic on HTTP and only the specific url of the request. This cant be so hard so fix with .NET only?

Update:

The key seem to be to use a Socket from the System.Net.Sockets namespace. Im not exactly sure how to use it correctly yet but Im following some other examples and it seem to be pretty easy.


I know you said don't want to use external libraries, but there is no simple way of intercepting the URLs requested by other processes without using other libraries.

In case you are interested, I used PCap .NET some time ago. It was really easy to use, and in few hours I had an application listening for HTTP communications between third party applications, and automating one of them depending on the captured info.

0

精彩评论

暂无评论...
验证码 换一张
取 消