Documentation ¶
Index ¶
Constants ¶
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 ¶
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.
Types ¶
type EdgeProxy ¶
type EdgeProxy struct { Config *config.EdgeProxyConfig ProxyServer *ProxyServer Socks5Proxy *Socks5Proxy }
EdgeProxy is used for traffic proxy
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)