func (p *ProxySrv) FlushProxy(domain string) {
	balancer.FlushProxy(domain)
}
Flush Flush proxy by domain
package libra
import (
	"bytes"
	"context"
	"crypto/tls"
	"github.com/zhuCheer/libra/balancer"
	"github.com/zhuCheer/libra/logger"
	"io/ioutil"
	"net"
	"net/http"
	"net/http/httputil"
	"net/url"
	"strings"
	"time"
)
type ProxySrv struct {
	ProxyAddr    string
	customHeader map[string]string
}
var (
	Logger      = logger.NoopLogger{}
	errorHeader = "x-libra-err"
	version     = "v0.0.1"
	githubUrl   = "https://github.com/zhuCheer/libra"
)
func NewHttpProxySrv(addr string, header map[string]string) *ProxySrv {
	if header == nil {
		header = map[string]string{}
	}
	return &ProxySrv{
		ProxyAddr:    addr,
		customHeader: header,
	}
}
func (p *ProxySrv) SetLoggerLevel(level string) {
	Logger.SetLevel(level)
}
func (p *ProxySrv) Start() error {
	proxyHttpMux := http.NewServeMux()
	Logger.Info("start proxy server bind " + p.ProxyAddr)
	proxyHttpMux.Handle("/", p.httpMiddleware(p.dynamicReverseProxy()))
	proxyServer := &http.Server{
		Addr:    p.ProxyAddr,
		Handler: proxyHttpMux,
	}
	err := proxyServer.ListenAndServe()
	panic(err)
}
func (p *ProxySrv) RegistSite(domain, loadType, scheme string) *ProxySrv {
	balancer.RegistTargetNoAddr(domain, loadType, scheme)
	return p
}
func (p *ProxySrv) GetSiteInfo(domain string) (*balancer.RegistNode, error) {
	info, err := balancer.GetSiteInfo(domain)
	return info, err
}
func (p *ProxySrv) AddAddr(domain string, addr string, weight uint32) *ProxySrv {
	info, err := balancer.GetSiteInfo(domain)
	if err == nil {
		info.Balancer.AddAddr(addr, weight)
	}
	return p
}
func (p *ProxySrv) DelAddr(domain string, addr string) {
	info, err := balancer.GetSiteInfo(domain)
	if err == nil {
		info.Balancer.DelAddr(addr)
	}
}