1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-29 22:48:07 +02:00

Dynamically add/remove proxy targets

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-12-25 14:39:37 -08:00
parent a028fd41fd
commit 62f95acdd7
2 changed files with 75 additions and 31 deletions

View File

@@ -55,9 +55,7 @@ func TestProxy(t *testing.T) {
URL: url2,
},
}
rb := &RandomBalancer{
Targets: targets,
}
rb := NewRandomBalancer(targets)
// Random
e := echo.New()
@@ -75,9 +73,7 @@ func TestProxy(t *testing.T) {
})
// Round-robin
rrb := &RoundRobinBalancer{
Targets: targets,
}
rrb := NewRoundRobinBalancer(targets)
e = echo.New()
e.Use(Proxy(rrb))
rec = newCloseNotifyRecorder()