proxy

package
v0.0.0-...-a563968 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterProxyFactory

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

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) GetConfigurer

func (pxy *BaseProxy) GetConfigurer() v1.ProxyConfigurer

func (*BaseProxy) GetLimiter

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

func (*BaseProxy) GetLoginMsg

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

func (*BaseProxy) GetName

func (pxy *BaseProxy) GetName() string

func (*BaseProxy) GetResourceController

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

func (*BaseProxy) GetUsedPortsNum

func (pxy *BaseProxy) GetUsedPortsNum() int

func (*BaseProxy) GetUserInfo

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

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

func (*HTTPProxy) Close

func (pxy *HTTPProxy) Close()

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) Run

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

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Add

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

func (*Manager) Del

func (pm *Manager) Del(name string)

func (*Manager) Exist

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

func (*Manager) GetByName

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

type Options

type Options struct {
	UserInfo           plugin.UserInfo
	LoginMsg           *msg.Login
	PoolCount          int
	ResourceController *controller.ResourceController
	GetWorkConnFn      GetWorkConnFn
	Configurer         v1.ProxyConfigurer
	ServerCfg          *v1.ServerConfig
}

type Proxy

type Proxy interface {
	Context() context.Context
	Run() (remoteAddr string, err error)
	GetName() string
	GetConfigurer() v1.ProxyConfigurer
	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

func NewHTTPProxy(baseProxy *BaseProxy) Proxy

func NewHTTPSProxy

func NewHTTPSProxy(baseProxy *BaseProxy) Proxy

func NewProxy

func NewProxy(ctx context.Context, options *Options) (pxy Proxy, err error)

func NewSTCPProxy

func NewSTCPProxy(baseProxy *BaseProxy) Proxy

func NewSUDPProxy

func NewSUDPProxy(baseProxy *BaseProxy) Proxy

func NewTCPMuxProxy

func NewTCPMuxProxy(baseProxy *BaseProxy) Proxy

func NewTCPProxy

func NewTCPProxy(baseProxy *BaseProxy) Proxy

func NewUDPProxy

func NewUDPProxy(baseProxy *BaseProxy) Proxy

func NewXTCPProxy

func NewXTCPProxy(baseProxy *BaseProxy) Proxy

type STCPProxy

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

func (*STCPProxy) Close

func (pxy *STCPProxy) Close()

func (*STCPProxy) Run

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

type SUDPProxy

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

func (*SUDPProxy) Close

func (pxy *SUDPProxy) Close()

func (*SUDPProxy) Run

func (pxy *SUDPProxy) 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) 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) 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) 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) 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