upstream

package
v0.0.0-...-cc0701e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	http.Client
}

func (*HttpClient) Do

func (cli *HttpClient) Do(req *http.Request) (resp *http.Response, err error)

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

type Upstream

type Upstream struct {

	//	Client      *http.Client
	Client *HttpClient
	// contains filtered or unexported fields
}

func NewHTTPSUpstream

func NewHTTPSUpstream(caCrtPath string) *Upstream

测试时,caCrtPath可以设置为"",客户端不会检验服务端发送过来的任何ca证书 线上时,建议caCrtPath设置为服务端下发的证书的本地路径,否则,可能遭受“中间人攻击”

func NewUnixUpstream

func NewUnixUpstream(sock string) *Upstream

func NewUpstream

func NewUpstream() *Upstream

func NewUpstreamWithTimeout

func NewUpstreamWithTimeout(dial, read, write, keepalive time.Duration) *Upstream

func NewUpstreamWithoutProxy

func NewUpstreamWithoutProxy() *Upstream

不需要走代理的UpStream

func (*Upstream) AddPeer

func (us *Upstream) AddPeer(host string, weight uint)

func (*Upstream) Close

func (us *Upstream) Close()

func (*Upstream) Getclient

func (us *Upstream) Getclient() *HttpClient

func (*Upstream) Gethost

func (us *Upstream) Gethost() string

func (*Upstream) RemovePeer

func (us *Upstream) RemovePeer(host string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL