Feature: move hosts to the top
This commit is contained in:
@ -213,6 +213,13 @@ func (t *Tunnel) match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
||||
defer t.configMux.RUnlock()
|
||||
|
||||
var resolved bool
|
||||
|
||||
if node := dns.DefaultHosts.Search(metadata.Host); node != nil {
|
||||
ip := node.Data.(net.IP)
|
||||
metadata.DstIP = &ip
|
||||
resolved = true
|
||||
}
|
||||
|
||||
for _, rule := range t.rules {
|
||||
if !resolved && t.shouldResolveIP(rule, metadata) {
|
||||
ip, err := t.resolveIP(metadata.Host)
|
||||
|
Reference in New Issue
Block a user