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,31 @@
package main
import (
"log"
"net/http"
"github.com/darkit/goproxy"
)
func main() {
// 创建证书缓存
certCache := &goproxy.MemCertCache{}
// 创建代理实例
proxy := goproxy.NewProxy(
goproxy.WithDecryptHTTPS(certCache),
goproxy.WithCACertAndKey("ca.crt", "ca.key"),
goproxy.WithEnableECDSA(true),
)
// 启动代理服务器
log.Println("HTTPS 到 HTTPS 代理服务器启动在 :8443")
log.Println("配置说明:")
log.Printf("- 支持 HTTPS 解密\n")
log.Printf("- 使用 ECDSA 证书\n")
log.Printf("- 最低 TLS 版本: 1.2\n")
log.Printf("- 最高 TLS 版本: 1.3\n")
if err := http.ListenAndServeTLS(":8443", "server.crt", "server.key", proxy); err != nil {
log.Fatalf("代理服务器启动失败: %v", err)
}
}