func newBackend(bec BackendConfig, serverHost, healthURL string) *backend {
	b := &backend{
		ServerHost: serverHost,
		HealthURL:  healthURL,
	}
	tr := &http.Transport{
		Dial: (&net.Dialer{
			Timeout:   time.Duration(bec.HealthTimeout),
			KeepAlive: 0,
		}).Dial,
		DisableKeepAlives:  true,
		DisableCompression: true,
	}
	b.healthClient = &http.Client{Transport: tr}
	b.Stats.Latency = ewma.NewMovingAverage(float64(bec.LatencyAvg))
	b.Stats.FailureRate = ewma.NewMovingAverage(10)
	tr = &http.Transport{
		Dial: func(network, addr string) (net.Conn, error) {
			return net.DialTimeout(network, addr, time.Duration(bec.DialTimeout))
		},
		Proxy: http.ProxyFromEnvironment,
	}
	b.rt = newStatTP(tr)
	if healthURL == "" {
		b.Stats.Healthy = true
	}
	if !bec.DisableHealth {
		b.closeMonitor = make(chan chan struct{}, 0)
		go b.startMonitor()
	}
	return b
}
newBackend returns a new generic backend.
It will start monitoring the backend at once
package server
import (
	"log"
	"net"
	"net/http"
	"strconv"
	"sync"
	"time"
	"github.com/VividCortex/ewma"
	"github.com/klauspost/shutdown"
)
type Backend interface {
	Transport() http.RoundTripper  
	ID() string                    
	Name() string                  
	Host() string                  
	Healthy() bool                 
	Statistics() *Stats            
	Connections() int              
	Close()                        
}
type backend struct {
	rt           *statRT
	healthClient *http.Client
	closeMonitor chan chan struct{}
	Stats        Stats
	ServerHost   string
	HealthURL    string
}