middleware/proxy: make it scale (#287)
* middleware/proxy Use connection pooling for communicating with an upstream, instead of opening a new socket every time. This makes the proxy more efficient and allowed for some cleanups. * Some cleanups * Some fixes * more * Kill pool * Add nil check * remove pool
This commit is contained in:
parent
f29f622ec7
commit
a05901f62a
9 changed files with 159 additions and 388 deletions
|
@ -20,7 +20,7 @@ func setup(c *caddy.Controller) error {
|
|||
return middleware.Error("proxy", err)
|
||||
}
|
||||
dnsserver.GetConfig(c).AddMiddleware(func(next middleware.Handler) middleware.Handler {
|
||||
return Proxy{Next: next, Client: Clients(), Upstreams: upstreams}
|
||||
return Proxy{Next: next, Client: NewClient(), Upstreams: upstreams}
|
||||
})
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue