proxy

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelKubeedge string = "kubeedge=edgemesh-agent"
	AgentPodName  string = "edgemesh-agent"

	// Version is socks5 version
	Version byte = 0x05

	// DefaultMethod is No certification required
	DefaultMethod byte = 0x00

	Success byte = 0x00

	// ATYPIPv4 is ipv4 address type
	ATYPIPv4 byte = 0x01 // 4 octets
	// ATYPDomain is domain address type
	ATYPDomain byte = 0x03 // The first octet of the address field contains the number of octets of name that follow, there is no terminating NUL octet.
	// ATYPIPv6 is ipv6 address type
	ATYPIPv6 byte = 0x04 // 16 octets

	// CmdConnect is connect command
	CmdConnect byte = 0x01
)

Variables

View Source
var DefaultResponse = []byte{Version, Success, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

DefaultResponse is Socks5 returns data by default

Functions

func NewDefaultKubeProxyConfiguration added in v1.10.0

func NewDefaultKubeProxyConfiguration(bindAddress string) *proxyconfigapi.KubeProxyConfiguration

NewDefaultKubeProxyConfiguration new default kube-proxy config for edgemesh-agent runtime. TODO(Poorunga) Use container config for this.

func Register

func Register(c *config.EdgeProxyConfig, ifm *informers.Manager) error

Register register edgeproxy to beehive modules

Types

type EdgeProxy

type EdgeProxy struct {
	Config      *config.EdgeProxyConfig
	ProxyServer *ProxyServer
	Socks5Proxy *Socks5Proxy
}

EdgeProxy is used for traffic proxy

func (*EdgeProxy) Enable

func (proxy *EdgeProxy) Enable() bool

Enable indicates whether enable this module

func (*EdgeProxy) Group

func (proxy *EdgeProxy) Group() string

Group of edgeproxy

func (*EdgeProxy) Name

func (proxy *EdgeProxy) Name() string

Name of edgeproxy

func (*EdgeProxy) Run

func (proxy *EdgeProxy) Run()

func (*EdgeProxy) Start

func (proxy *EdgeProxy) Start()

Start edgeproxy

type ProxyServer added in v1.10.0

type ProxyServer struct {
	Client       clientset.Interface
	IstioClient  istioclientset.Interface
	IptInterface utiliptables.Interface

	Proxier           proxy.Provider
	ProxyMode         string
	UseEndpointSlices bool
	ConfigSyncPeriod  time.Duration
	// contains filtered or unexported fields
}

ProxyServer represents all the parameters required to start the Kubernetes proxy server.

func (*ProxyServer) CleanupAndExit added in v1.10.0

func (s *ProxyServer) CleanupAndExit() error

CleanupAndExit remove iptables rules and ipset/ipvs rules in ipvs proxy mode and exit if success return nil

func (*ProxyServer) Run added in v1.10.0

func (s *ProxyServer) Run() error

Run runs the specified ProxyServer. This should never exit (unless CleanupAndExit is set).

type Request added in v1.10.0

type Request struct {
	Version     byte
	Command     byte
	Rsv         byte
	AddressType byte
	DstAddr     string
	DstPort     int32
}

copy form https://github.com/txthinking/socks5/blob/e03c1217a50bd1363a2aaf58290da622256704fa/socks5.go#from L86 and update

type Socks5Proxy added in v1.10.0

type Socks5Proxy struct {
	TCPProxy *protocol.TCPProxy

	NodeName    string
	SocksHandle *SocksHandle
	// contains filtered or unexported fields
}

func NewSocks5Proxy added in v1.10.0

func NewSocks5Proxy(ip net.IP, port int, NodeName string, kubeClient kubernetes.Interface) (socks5Proxy *Socks5Proxy, err error)

func (*Socks5Proxy) HandleSocksProxy added in v1.10.0

func (s *Socks5Proxy) HandleSocksProxy(conn net.Conn)

func (*Socks5Proxy) Start added in v1.10.0

func (s *Socks5Proxy) Start()

type SocksHandle added in v1.10.0

type SocksHandle struct {
	Request *Request
}

func (*SocksHandle) NewRequest added in v1.10.0

func (s *SocksHandle) NewRequest(conn net.Conn) (err error)

copy from https://github.com/txthinking/socks5/blob/e03c1217a50bd1363a2aaf58290da622256704fa/server_side.go#L125 and update

func (*SocksHandle) ParsingConnect added in v1.10.0

func (s *SocksHandle) ParsingConnect(conn net.Conn) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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