MicroDev
MicroDev

Reputation: 1

Listen to outgoing http/https requests in GoLang

I'm trying to make a GoLang program, that logs every outgoing http/https request when it runs on the computer, for example, when it's running it on my computer, when I open a browser and open http://example.com, it logs it. An appreciated extra would be a way to redirect some unwanted website requests (like a parental control)

I've been trying and looking all around and it seems that all the examples out there consider the computer where the Go exe is running as a server.. That's not what I want

Thank you very much

Upvotes: 0

Views: 1296

Answers (1)

BJ Black
BJ Black

Reputation: 2531

Techniques for "getting every request" off a computer will vary a bit if your intent is to trap things that don't use common HTTP proxy settings (and things get a bit weird if SSL/TLS is involved, which on the modern Internet it almost assuredly is). So let's ignore the complications of trying to actually get an unencrypted channel to MitM...

Assuming you're writing a simple HTTP proxy at first and expanding on that, try GoProxy. It has a good list of examples and a decent feature list.

Upvotes: 1

Related Questions