add support for enable_proxy_protocol
setting this to true will enable proxy protocol support in the loadbalancer
This commit is contained in:
parent
7a99fd7cb2
commit
f829cd4f97
|
@ -42,6 +42,7 @@ type LoadBalancer struct {
|
||||||
Tag string `json:"tag,omitempty"`
|
Tag string `json:"tag,omitempty"`
|
||||||
Tags []string `json:"tags,omitempty"`
|
Tags []string `json:"tags,omitempty"`
|
||||||
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
|
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
|
||||||
|
EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// String creates a human-readable description of a LoadBalancer.
|
// String creates a human-readable description of a LoadBalancer.
|
||||||
|
@ -63,6 +64,7 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest {
|
||||||
DropletIDs: append([]int(nil), l.DropletIDs...),
|
DropletIDs: append([]int(nil), l.DropletIDs...),
|
||||||
Tag: l.Tag,
|
Tag: l.Tag,
|
||||||
RedirectHttpToHttps: l.RedirectHttpToHttps,
|
RedirectHttpToHttps: l.RedirectHttpToHttps,
|
||||||
|
EnableProxyProtocol: l.EnableProxyProtocol,
|
||||||
HealthCheck: l.HealthCheck,
|
HealthCheck: l.HealthCheck,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +137,7 @@ type LoadBalancerRequest struct {
|
||||||
Tag string `json:"tag,omitempty"`
|
Tag string `json:"tag,omitempty"`
|
||||||
Tags []string `json:"tags,omitempty"`
|
Tags []string `json:"tags,omitempty"`
|
||||||
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
|
RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"`
|
||||||
|
EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// String creates a human-readable description of a LoadBalancerRequest.
|
// String creates a human-readable description of a LoadBalancerRequest.
|
||||||
|
|
|
@ -824,6 +824,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
|
||||||
Slug: "lon1",
|
Slug: "lon1",
|
||||||
},
|
},
|
||||||
RedirectHttpToHttps: true,
|
RedirectHttpToHttps: true,
|
||||||
|
EnableProxyProtocol: true,
|
||||||
}
|
}
|
||||||
lb.DropletIDs = make([]int, 1, 2)
|
lb.DropletIDs = make([]int, 1, 2)
|
||||||
lb.DropletIDs[0] = 12345
|
lb.DropletIDs[0] = 12345
|
||||||
|
@ -861,6 +862,7 @@ func TestLoadBalancers_AsRequest(t *testing.T) {
|
||||||
},
|
},
|
||||||
DropletIDs: []int{12345},
|
DropletIDs: []int{12345},
|
||||||
RedirectHttpToHttps: true,
|
RedirectHttpToHttps: true,
|
||||||
|
EnableProxyProtocol: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
r := lb.AsRequest()
|
r := lb.AsRequest()
|
||||||
|
|
Loading…
Reference in New Issue