proxy

package
v0.51.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterProxyFactory added in v0.51.1

func RegisterProxyFactory(proxyConfType reflect.Type, factory func(*BaseProxy, config.ProxyConf) Proxy)

Types

type BaseProxy

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

func (*BaseProxy) Close

func (pxy *BaseProxy) Close()

func (*BaseProxy) Context added in v0.37.2

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

func (*BaseProxy) GetLimiter added in v0.51.1

func (pxy *BaseProxy) GetLimiter() *rate.Limiter

func (*BaseProxy) GetLoginMsg added in v0.51.1

func (pxy *BaseProxy) GetLoginMsg() *msg.Login

func (*BaseProxy) GetName

func (pxy *BaseProxy) GetName() string

func (*BaseProxy) GetResourceController added in v0.37.2

func (pxy *BaseProxy) GetResourceController() *controller.ResourceController

func (*BaseProxy) GetUsedPortsNum

func (pxy *BaseProxy) GetUsedPortsNum() int

func (*BaseProxy) GetUserInfo added in v0.37.2

func (pxy *BaseProxy) GetUserInfo() plugin.UserInfo

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 added in v0.37.2

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

func (*HTTPProxy) Close added in v0.37.2

func (pxy *HTTPProxy) Close()

func (*HTTPProxy) GetConf added in v0.37.2

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

func (*HTTPProxy) GetRealConn added in v0.37.2

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

func (*HTTPProxy) Run added in v0.37.2

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

type HTTPSProxy added in v0.37.2

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

func (*HTTPSProxy) Close added in v0.37.2

func (pxy *HTTPSProxy) Close()

func (*HTTPSProxy) GetConf added in v0.37.2

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

func (*HTTPSProxy) Run added in v0.37.2

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

type Manager added in v0.37.2

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

func NewManager added in v0.37.2

func NewManager() *Manager

func (*Manager) Add added in v0.37.2

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

func (*Manager) Del added in v0.37.2

func (pm *Manager) Del(name string)

func (*Manager) Exist added in v0.51.1

func (pm *Manager) Exist(name string) bool

func (*Manager) GetByName added in v0.37.2

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

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
	GetResourceController() *controller.ResourceController
	GetUserInfo() plugin.UserInfo
	GetLimiter() *rate.Limiter
	GetLoginMsg() *msg.Login
	Close()
}

func NewHTTPProxy added in v0.51.1

func NewHTTPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewHTTPSProxy added in v0.51.1

func NewHTTPSProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewProxy

func NewProxy(ctx context.Context, userInfo plugin.UserInfo, rc *controller.ResourceController, poolCount int,
	getWorkConnFn GetWorkConnFn, pxyConf config.ProxyConf, serverCfg config.ServerCommonConf, loginMsg *msg.Login,
) (pxy Proxy, err error)

func NewSTCPProxy added in v0.51.1

func NewSTCPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewSUDPProxy added in v0.51.1

func NewSUDPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewTCPMuxProxy added in v0.51.1

func NewTCPMuxProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewTCPProxy added in v0.51.1

func NewTCPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewUDPProxy added in v0.51.1

func NewUDPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

func NewXTCPProxy added in v0.51.1

func NewXTCPProxy(baseProxy *BaseProxy, cfg config.ProxyConf) Proxy

type STCPProxy added in v0.37.2

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

func (*STCPProxy) Close added in v0.37.2

func (pxy *STCPProxy) Close()

func (*STCPProxy) GetConf added in v0.37.2

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

func (*STCPProxy) Run added in v0.37.2

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

type SUDPProxy added in v0.37.2

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

func (*SUDPProxy) Close added in v0.37.2

func (pxy *SUDPProxy) Close()

func (*SUDPProxy) GetConf added in v0.37.2

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

func (*SUDPProxy) Run added in v0.37.2

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

type TCPMuxProxy added in v0.37.2

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

func (*TCPMuxProxy) Close added in v0.37.2

func (pxy *TCPMuxProxy) Close()

func (*TCPMuxProxy) GetConf added in v0.37.2

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

func (*TCPMuxProxy) Run added in v0.37.2

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

type TCPProxy added in v0.37.2

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

func (*TCPProxy) Close added in v0.37.2

func (pxy *TCPProxy) Close()

func (*TCPProxy) GetConf added in v0.37.2

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

func (*TCPProxy) Run added in v0.37.2

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

type UDPProxy added in v0.37.2

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

func (*UDPProxy) Close added in v0.37.2

func (pxy *UDPProxy) Close()

func (*UDPProxy) GetConf added in v0.37.2

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

func (*UDPProxy) Run added in v0.37.2

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

type XTCPProxy added in v0.37.2

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

func (*XTCPProxy) Close added in v0.37.2

func (pxy *XTCPProxy) Close()

func (*XTCPProxy) GetConf added in v0.37.2

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

func (*XTCPProxy) Run added in v0.37.2

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