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.
Types ¶
type EdgeProxy ¶
type EdgeProxy struct { Config *v1alpha1.EdgeProxyConfig ProxyServer *Server Socks5Proxy *Socks5Proxy }
EdgeProxy is used for traffic proxy
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
CleanupAndExit remove iptables rules
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) NewRequest ¶
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 ¶
func (s *SocksHandle) ParsingConnect(conn net.Conn) (err error)
Click to show internal directories.
Click to hide internal directories.