Open nik-ngp opened 7 months ago
I also tried Reddit blocking example, doesn't work. Go version 1.22.2
Replicated the issue in a Linux VM.
It does work, however, I'd need to set trusted root cert if I wish to intercept HTTPS traffic.
Correct, maybe I should add setting root cert to the example.
On Fri, Apr 12, 2024, 15:06 nik-ngp @.***> wrote:
It does work, however, I'd need to set trusted root cert if I wish to intercept HTTPS traffic.
— Reply to this email directly, view it on GitHub https://github.com/elazarl/goproxy/issues/533#issuecomment-2051632667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB7RIRKLPFHZDJHQD3SIW3Y47E4LAVCNFSM6AAAAABGB7SNGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJRGYZTENRWG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
That would be quite real helpful to have an example with the cert. Maybe even, if not too much to ask, an option to generate keys, serialize them into a certificate so that the whole system can trust it.
I will kindly re-open the ticket with this comment. If you're willing to proceed with the additional example we can attach a PR to this issue.
Hello @elazarl . I think such an example for root cert would be really useful. Do you have maybe a timeline of when you could do it for us? :)
I basically copy and pasted the example of http-dump, however, nothing is being written to log. It's just empty. I also tried using .OnRequest().DoFunc() however it's not working as well.
The following code would never panic for some strange reason.
It would however proxy the traffic normally and print in the console: $ HOST=127.0.0.1 PORT=8081 go run . 2024/04/11 11:57:40 [001] INFO: Running 0 CONNECT handlers 2024/04/11 11:57:40 [002] INFO: Running 0 CONNECT handlers 2024/04/11 11:57:40 [003] INFO: Running 0 CONNECT handlers 2024/04/11 11:57:40 [001] INFO: Accepting CONNECT to www.google.com:443
` package main
import ( "api/env" "fmt" "net" "net/http" "os"
)
func main() { proxy := goproxy.NewProxyHttpServer() proxy.Verbose = true
} `
Edit: Some random POST requests would go trough an call the hook. Log: 2024/04/11 12:00:31 [020] INFO: Got request / ocsp.sectigo.com POST http://ocsp.sectigo.com/