feat(agentproxy): simplify configuration handling and related header management

This commit is contained in:
yusing
2025-09-21 11:52:42 +08:00
parent ccdc0046fd
commit 74a215b894
5 changed files with 104 additions and 51 deletions

View File

@@ -3,12 +3,12 @@ package route
import (
"crypto/tls"
"crypto/x509"
"net/url"
"os"
"strings"
"time"
"github.com/yusing/go-proxy/internal/gperr"
nettypes "github.com/yusing/go-proxy/internal/net/types"
)
type HTTPConfig struct {
@@ -25,7 +25,7 @@ type HTTPConfig struct {
}
// BuildTLSConfig creates a TLS configuration based on the HTTP config options.
func (cfg *HTTPConfig) BuildTLSConfig(targetURL *nettypes.URL) (*tls.Config, gperr.Error) {
func (cfg *HTTPConfig) BuildTLSConfig(targetURL *url.URL) (*tls.Config, gperr.Error) {
tlsConfig := &tls.Config{}
// Handle InsecureSkipVerify (legacy NoTLSVerify option)