[功能] 添加支持多个上游地址,优化代理路由配置和负载均衡逻辑

This commit is contained in:
ryan
2026-03-18 22:24:05 +08:00
parent c844f4c784
commit 1fbe156a7c
13 changed files with 287 additions and 39 deletions
+2
View File
@@ -7,6 +7,7 @@ type ProxyRoute struct {
Domain string `json:"domain" gorm:"uniqueIndex;size:255;not null"`
OriginURL string `json:"origin_url" gorm:"size:2048;not null"`
OriginHost string `json:"origin_host" gorm:"size:255"`
Upstreams string `json:"upstreams" gorm:"type:text;not null;default:'[]'"`
Enabled bool `json:"enabled" gorm:"not null;default:true"`
EnableHTTPS bool `json:"enable_https" gorm:"column:enable_https;not null;default:false"`
CertID *uint `json:"cert_id"`
@@ -45,6 +46,7 @@ func (route *ProxyRoute) Update() error {
"domain": route.Domain,
"origin_url": route.OriginURL,
"origin_host": route.OriginHost,
"upstreams": route.Upstreams,
"enabled": route.Enabled,
"enable_https": route.EnableHTTPS,
"cert_id": route.CertID,