middleware/proxy: absorb httpproxy (#481)
* middleware/proxy: absorb httpproxy Move the httproxy into proxy. This adds and Exchanger interface which is used to exchange the messages with the upstream. The https_google upstream will re-resolve itself and update the upstream hosts used every 300s. * Remove and add TODO
This commit is contained in:
parent
77f957d443
commit
123a76c91e
21 changed files with 466 additions and 827 deletions
|
@ -8,11 +8,9 @@ import (
|
|||
// Exchanger is an interface that specifies a type implementing a DNS resolver that
|
||||
// can use whatever transport it likes.
|
||||
type Exchanger interface {
|
||||
Exchange(request.Request) (*dns.Msg, error)
|
||||
SetUpstream(Upstream) error // (Re)set the upstream
|
||||
OnStartup() error
|
||||
OnShutdown() error
|
||||
Protocol() protocol
|
||||
}
|
||||
Exchange(addr string, state request.Request) (*dns.Msg, error)
|
||||
Protocol() string
|
||||
|
||||
type protocol string
|
||||
OnStartup(*Proxy) error
|
||||
OnShutdown(*Proxy) error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue