reverse_proxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 17 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

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,在这里完成下游连接与数据交换

Jump to

Keyboard shortcuts

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