func createTransport(options *HTTPOptions, cache *dnscache.Cache) *http.Transport {
	transport := http.DefaultTransport.(*http.Transport).Clone()
	transport.MaxIdleConnsPerHost = options.MaxIdleConnsPerHost
	transport.MaxConnsPerHost = options.MaxConnsPerHost
	transport.DisableKeepAlives = options.DisableKeepAlives
	transport.DisableCompression = options.DisableCompression
	if options.InsecureSkipVerify {
		transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: options.InsecureSkipVerify}
	}
	if options.IdleConnTimeout > 0 {
		transport.IdleConnTimeout = options.IdleConnTimeout
	}
	if options.MaxIdleConns > 0 {
		transport.MaxIdleConns = options.MaxIdleConns
	}
	if options.TLSHandshakeTimeout > 0 {
		transport.TLSHandshakeTimeout = options.TLSHandshakeTimeout
	}
	transport.Proxy = func(req *http.Request) (*url.URL, error) {
		reqOptions, ok := req.Context().Value(ctxOptionKey).(*ReqOptions)
		if ok && len(reqOptions.Proxies) > 0 {
			if p, ok := reqOptions.Proxies[req.URL.Scheme]; ok {
				return p, nil
			}
		} else if len(options.Proxies) > 0 {
			if p, ok := options.Proxies[req.URL.Scheme]; ok {
				return p, nil
			}
		}
		return http.ProxyFromEnvironment(req)
	}
	dialer := &net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
	}
	if options.DialTimeout > 0 {
		dialer.Timeout = options.DialTimeout
	}
	if options.KeepAlive != 0 {
		dialer.KeepAlive = options.KeepAlive
	}
	transport.DialContext = makeDialContext(dialer, cache)
	return transport
}
createTransport create a global *http.Transport for all http client
package zhttp
import (
	"context"
	"crypto/tls"
	"fmt"
	"net"
	"net/http"
	"net/url"
	"time"
	"github.com/greyh4t/dnscache"
)
var ctxOptionKey = struct{}{}
func disableRedirect(req *http.Request, via []*http.Request) error {
	return http.ErrUseLastResponse
}
func (z *Zhttp) buildClient(httpOptions *HTTPOptions, reqOptions *ReqOptions, cookieJar http.CookieJar) *http.Client {
	client := &http.Client{
		Transport: z.transport,
		Jar:       cookieJar,
		Timeout:   httpOptions.RequestTimeout,
	}
	if reqOptions.RequestTimeout > 0 {
		client.Timeout = reqOptions.RequestTimeout
	}
	if reqOptions.DisableRedirect {
		client.CheckRedirect = disableRedirect
	}
	return client
}