修改反向代理实现

This commit is contained in:
GoEdgeLab
2020-09-21 11:37:17 +08:00
parent 0f4dbc1def
commit 62b9efe0e6
8 changed files with 240 additions and 92 deletions

View File

@@ -71,6 +71,7 @@ func (this *ReverseProxyDAO) ComposeReverseProxyConfig(reverseProxyId int64) (*s
}
config := &serverconfigs.ReverseProxyConfig{}
config.Id = int64(reverseProxy.Id)
config.IsOn = reverseProxy.IsOn == 1
schedulingConfig := &serverconfigs.SchedulingConfig{}
@@ -121,6 +122,7 @@ func (this *ReverseProxyDAO) ComposeReverseProxyConfig(reverseProxyId int64) (*s
// 创建反向代理
func (this *ReverseProxyDAO) CreateReverseProxy(schedulingJSON []byte, primaryOriginsJSON []byte, backupOriginsJSON []byte) (int64, error) {
op := NewReverseProxyOperator()
op.IsOn = false
op.State = ReverseProxyStateEnabled
if len(schedulingJSON) > 0 {
op.Scheduling = string(schedulingJSON)