Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDNSCache = &SimpleDNSCache{}
Functions ¶
func LookupReachable ¶
LookupReachable tries to resolve addr via connecting to it. This method has much more overhead, but get guaranteed reachable resolved addr. Example: host is resolved to IPv4 and IPv6, but IPv4 is not working on machine. LookupReachable will return IPv6 in that case.
func ValidHTTPMethod ¶ added in v0.5.5
ValidHTTPMethod just copy net/http/request.go validMethod(method string) bool
func WarmDNSCache ¶
WarmDNSCache tries connect to addr, and adds conn remote ip + addr port to cache.
Types ¶
type DialerFunc ¶
func NewDNSCachingDialer ¶
func NewDNSCachingDialer(dialer Dialer, cache DNSCache) DialerFunc
NewDNSCachingDialer returns dialer with primitive DNS caching logic that remembers remote address on first try, and use it in future.
func (DialerFunc) DialContext ¶
type SimpleDNSCache ¶
type SimpleDNSCache struct {
// contains filtered or unexported fields
}
func (*SimpleDNSCache) Add ¶
func (c *SimpleDNSCache) Add(addr, resolved string)
Click to show internal directories.
Click to hide internal directories.