proxy

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

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

	// 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

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 *v1alpha1.EdgeProxyConfig, cli *clients.Clients) error

Register edgeproxy to beehive modules

Types

type EdgeProxy

type EdgeProxy struct {
	Config      *v1alpha1.EdgeProxyConfig
	ProxyServer *Server
	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) Shutdown added in v1.13.1

func (proxy *EdgeProxy) Shutdown()

Shutdown edgeproxy

func (*EdgeProxy) Start

func (proxy *EdgeProxy) Start()

Start edgeproxy

type Request

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

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

type Server added in v1.15.0

type Server struct {
	IptInterface utiliptables.Interface

	Proxier          proxy.Provider
	ConfigSyncPeriod time.Duration
	// contains filtered or unexported fields
}

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

func (*Server) CleanupAndExit added in v1.15.0

func (s *Server) CleanupAndExit() error

CleanupAndExit remove iptables rules

func (*Server) Run added in v1.15.0

func (s *Server) Run() error

type Socks5Proxy

type Socks5Proxy struct {
	Config *v1alpha1.Socks5Proxy

	SocksHandle *SocksHandle
	// contains filtered or unexported fields
}

func NewSocks5Proxy

func NewSocks5Proxy(config *v1alpha1.Socks5Proxy, ip net.IP, kubeClient kubernetes.Interface) (socks5Proxy *Socks5Proxy, err error)

func (*Socks5Proxy) HandleSocksProxy

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

func (*Socks5Proxy) Start

func (s *Socks5Proxy) Start(stop <-chan struct{})

type SocksHandle

type SocksHandle struct {
	Request *Request
}

func (*SocksHandle) ParsingConnect

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

Jump to

Keyboard shortcuts

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