This commit is contained in:
2025-03-14 18:50:49 +00:00
commit 1a53a9a8f3
90 changed files with 13116 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package main
import (
"log"
"net/http"
"github.com/darkit/goproxy"
)
func main() {
// 创建证书缓存
certCache := &goproxy.MemCertCache{}
// 创建代理实例,启用 HTTPS 解密
proxy := goproxy.NewProxy(
goproxy.WithDecryptHTTPS(certCache),
goproxy.WithCACertAndKey("ca.crt", "ca.key"),
goproxy.WithEnableECDSA(true),
)
// 启动代理服务器
log.Println("HTTPS 解密代理服务器启动在 :8080")
log.Println("请确保已安装 CA 证书 (ca.crt)")
if err := http.ListenAndServe(":8080", proxy); err != nil {
log.Fatalf("代理服务器启动失败: %v", err)
}
}