c# Record outgoing http(s) requests from system/browser

I want a simple c# code which logs or retrieve last requested url by any of browser in the system.
As per my knowledge (correct me if its wrong) any url requested in browser went to TCP , so any way we tracked before initiated by TCP.
Bharpinder SinghDeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul MacDonaldDirector, Information SystemsCommented:
You need a proxy server, not C# code.

It's true web browser traffic uses TCP/IP, but so does almost all the other network traffic your computer generates.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bharpinder SinghDeveloperAuthor Commented:
i used socket
            byte[] input = BitConverter.GetBytes(1);
            byte[] buffer = new byte[4096];
            Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
            s.Bind(new IPEndPoint(IPAddress.Parse(GetLocalIPAddress()), 0));
            s.IOControl(IOControlCode.ReceiveAll, input, null);

            int bytes = 0;
                bytes = s.Receive(buffer);
                if (bytes > 0)

      if(Encoding.UTF8.GetString(buffer, 0, bytes).Contains(WEBSITEURLHERE)){

 } while (bytes > 0);
        catch (Exception ex)
              File.WriteAllText("C:/Hlogs/DeviceNotFound/httplistner.txt", ex.ToString());
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.