Quickstart: Create a basic HTTP/HTTPS proxy
masterTo start with a basic proxy that forwards data to the destination, use goproxy.NewProxyHttpServer(). By default, this example runs on localhost:8080. Note that for HTTPS MITM functionality, you must trust the proxy CA certificate in your client (browser) to avoid certificate errors.
package main
import (
"log"
"net/http"
"github.com/elazarl/goproxy"
)
func main() {
proxy := goproxy.NewProxyHttpServer()
proxy.Verbose = true
log.Fatal(http.ListenAndServe(":8080", proxy))
}