func NewProxy(transport http.RoundTripper, cache Cache) *Proxy {
	if transport == nil {
		transport, _ = aia.NewTransport()
	}
	if cache == nil {
		cache = NopCache
	}
	proxy := &Proxy{
		Cache: cache,
	}
	client := new(http.Client)
	client.Transport = &httpcache.Transport{
		Transport: &TransformingTransport{
			Transport:     transport,
			CachingClient: client,
			log: func(format string, v ...interface{}) {
				if proxy.Verbose {
					proxy.logf(format, v...)
				}
			},
		},
		Cache:               cache,
		MarkCachedResponses: true,
	}
	proxy.Client = client
	return proxy
}
NewProxy constructs a new proxy.  The provided http RoundTripper will be
used to fetch remote URLs.  If nil is provided, http.DefaultTransport will
be used.
package imageproxy  
import (
	"bufio"
	"bytes"
	"crypto/hmac"
	"crypto/sha256"
	"encoding/base64"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"mime"
	"net"
	"net/http"
	"net/url"
	"path"
	"strings"
	"time"
	"github.com/fcjr/aia-transport-go"
	"github.com/gregjones/httpcache"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	tphttp "willnorris.com/go/imageproxy/third_party/http"
)
type Proxy struct {
	Client *http.Client  
	Cache  Cache         
	AllowHosts []string
	DenyHosts []string
	Referrers []string
	IncludeReferer bool
	FollowRedirects bool
	DefaultBaseURL *url.URL
	Logger *log.Logger
	SignatureKeys [][]byte
	ScaleUp bool
	Timeout time.Duration
	Verbose bool
	ContentTypes []string
	UserAgent string
}