proxy

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleUserTcpConnection

func HandleUserTcpConnection(pxy Proxy, userConn net.Conn, serverCfg config.ServerCommonConf)

HandleUserTcpConnection is used for incoming tcp user connections. It can be used for tcp, http, https type.

Types

type BaseProxy

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

func (*BaseProxy) Close

func (pxy *BaseProxy) Close()

func (*BaseProxy) Context

func (pxy *BaseProxy) Context() context.Context

func (*BaseProxy) GetName

func (pxy *BaseProxy) GetName() string

func (*BaseProxy) GetUsedPortsNum

func (pxy *BaseProxy) GetUsedPortsNum() int

func (*BaseProxy) GetWorkConnFromPool

func (pxy *BaseProxy) GetWorkConnFromPool(src, dst net.Addr) (workConn net.Conn, err error)

GetWorkConnFromPool try to get a new work connections from pool for quickly response, we immediately send the StartWorkConn message to frpc after take out one from pool

type GetWorkConnFn

type GetWorkConnFn func() (net.Conn, error)

type HttpProxy

type HttpProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*HttpProxy) Close

func (pxy *HttpProxy) Close()

func (*HttpProxy) GetConf

func (pxy *HttpProxy) GetConf() config.ProxyConf

func (*HttpProxy) GetRealConn

func (pxy *HttpProxy) GetRealConn(remoteAddr string) (workConn net.Conn, err error)

func (*HttpProxy) Run

func (pxy *HttpProxy) Run() (remoteAddr string, err error)

type HttpsProxy

type HttpsProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*HttpsProxy) Close

func (pxy *HttpsProxy) Close()

func (*HttpsProxy) GetConf

func (pxy *HttpsProxy) GetConf() config.ProxyConf

func (*HttpsProxy) Run

func (pxy *HttpsProxy) Run() (remoteAddr string, err error)

type Proxy

type Proxy interface {
	Context() context.Context
	Run() (remoteAddr string, err error)
	GetName() string
	GetConf() config.ProxyConf
	GetWorkConnFromPool(src, dst net.Addr) (workConn net.Conn, err error)
	GetUsedPortsNum() int
	Close()
}

func NewProxy

func NewProxy(ctx context.Context, runId string, rc *controller.ResourceController, poolCount int,
	getWorkConnFn GetWorkConnFn, pxyConf config.ProxyConf, serverCfg config.ServerCommonConf) (pxy Proxy, err error)

type ProxyManager

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

func NewProxyManager

func NewProxyManager() *ProxyManager

func (*ProxyManager) Add

func (pm *ProxyManager) Add(name string, pxy Proxy) error

func (*ProxyManager) Del

func (pm *ProxyManager) Del(name string)

func (*ProxyManager) GetByName

func (pm *ProxyManager) GetByName(name string) (pxy Proxy, ok bool)

type StcpProxy

type StcpProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*StcpProxy) Close

func (pxy *StcpProxy) Close()

func (*StcpProxy) GetConf

func (pxy *StcpProxy) GetConf() config.ProxyConf

func (*StcpProxy) Run

func (pxy *StcpProxy) Run() (remoteAddr string, err error)

type TcpMuxProxy

type TcpMuxProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*TcpMuxProxy) Close

func (pxy *TcpMuxProxy) Close()

func (*TcpMuxProxy) GetConf

func (pxy *TcpMuxProxy) GetConf() config.ProxyConf

func (*TcpMuxProxy) Run

func (pxy *TcpMuxProxy) Run() (remoteAddr string, err error)

type TcpProxy

type TcpProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*TcpProxy) Close

func (pxy *TcpProxy) Close()

func (*TcpProxy) GetConf

func (pxy *TcpProxy) GetConf() config.ProxyConf

func (*TcpProxy) Run

func (pxy *TcpProxy) Run() (remoteAddr string, err error)

type UdpProxy

type UdpProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*UdpProxy) Close

func (pxy *UdpProxy) Close()

func (*UdpProxy) GetConf

func (pxy *UdpProxy) GetConf() config.ProxyConf

func (*UdpProxy) Run

func (pxy *UdpProxy) Run() (remoteAddr string, err error)

type XtcpProxy

type XtcpProxy struct {
	*BaseProxy
	// contains filtered or unexported fields
}

func (*XtcpProxy) Close

func (pxy *XtcpProxy) Close()

func (*XtcpProxy) GetConf

func (pxy *XtcpProxy) GetConf() config.ProxyConf

func (*XtcpProxy) Run

func (pxy *XtcpProxy) Run() (remoteAddr string, err error)

Jump to

Keyboard shortcuts

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