How to listen to GET and POST requests for all connections using GO

huangapple go评论81阅读模式
英文:

How to listen to GET and POST requests for all connections using GO

问题

我正在使用Python和mitmproxy来监听所有的进出流量,以便我可以捕获URL。我运行脚本后,它会告诉我我的计算机正在尝试连接的所有URL。

我需要使用Go来实现相同的功能,但是我不知道如何开始或者使用哪个包。有人可以指导我正确的方向吗?

谢谢。

英文:

I am using python and mitmproxy to listen to all incoming and outgoing traffic so that I can capture the URLs. I run the script and it tells me all URLs my computer is trying to connect to.

I need to implement the same using Go but have not got a clue on how to start or what package to use. Can anyone guide me in the right direction please?

Thanks

答案1

得分: 0

你需要一个本地的中间代理,以便捕获其流量并显示所使用的URL。

例如,在Go语言中,可以使用sipt/shuttle,它具有GUI Web界面:

How to listen to GET and POST requests for all connections using GO

英文:

You would need a local intermediate proxy, in order to capture its traffic and display the URLs used.

See for example, in Go, sipt/shuttle, with its GUI web interface:

How to listen to GET and POST requests for all connections using GO

答案2

得分: 0

你可以使用httputil轻松构建代理,这里有一个示例链接
或者你可能想使用gopacket,可以在这里找到相关描述。

英文:

You can either easily build a proxy with httputil - example here.
Or you might want to use gopacket as described here.

huangapple
  • 本文由 发表于 2022年2月27日 21:35:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/71285174.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定