if no dns then no resolver nor dig nor nothin
parent
a690dd2f9a
commit
9a60d782e3
|
|
@ -32,7 +32,7 @@ func NewServer(c *Config) *Server {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if c.DNS == "" {
|
if c.DNS == "" {
|
||||||
resolver = &net.Resolver{}
|
resolver = nil
|
||||||
}
|
}
|
||||||
transport := &http.Transport{}
|
transport := &http.Transport{}
|
||||||
transport.TLSClientConfig = &tls.Config{
|
transport.TLSClientConfig = &tls.Config{
|
||||||
|
|
@ -133,6 +133,9 @@ func (s *Server) xfer(ctx context.Context, w io.Writer, r io.ReadCloser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) dig(ctx context.Context, host string) (string, error) {
|
func (s *Server) dig(ctx context.Context, host string) (string, error) {
|
||||||
|
if s.resolver == nil {
|
||||||
|
return host, nil
|
||||||
|
}
|
||||||
search := host
|
search := host
|
||||||
search = strings.TrimPrefix(search, "https://")
|
search = strings.TrimPrefix(search, "https://")
|
||||||
search = strings.TrimPrefix(search, "http://")
|
search = strings.TrimPrefix(search, "http://")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue