reverse_proxy

package
v0.0.0-...-132f7fb Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGrpcLoadBalanceHandler

func NewGrpcLoadBalanceHandler(lb load_balance.LoadBalance) grpc.StreamHandler

func NewLoadBalanceReverseProxy

func NewLoadBalanceReverseProxy(c *gin.Context, lb load_balance.LoadBalance, trans *http.Transport) *httputil.ReverseProxy

func ReverseProxyForHttpNode

func ReverseProxyForHttpNode()

func ReverseProxyForHttpsNode

func ReverseProxyForHttpsNode(director func(req *http.Request), modifyFunc func(resp *http.Response) error, errFunc func(w http.ResponseWriter, r *http.Request, err error)) *httputil.ReverseProxy

Types

type TcpReverseProxy

type TcpReverseProxy struct {
	Addr                 string
	KeepAlivePeriod      time.Duration //设置
	DialTimeout          time.Duration //设置超时时间
	DialContext          func(ctx context.Context, network, address string) (net.Conn, error)
	OnDialError          func(src net.Conn, dstDialErr error)
	ProxyProtocolVersion int
	// contains filtered or unexported fields
}

TCP反向代理

func (*TcpReverseProxy) ServeTCP

func (dp *TcpReverseProxy) ServeTCP(ctx context.Context, src net.Conn)

传入上游 conn,在这里完成下游连接与数据交换

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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