Versions in this module Expand all Collapse all v0 v0.0.1 Jul 2, 2024 Changes in this version + const DefaultDialTimeout + const DefaultSocketTimeout + const HttpProxyAddr + const Socks5ProxyAddr + var HttpProxyURL = url.Parse(fmt.Sprintf("http://%s", HttpProxyAddr)) + var NETPROXY_ENABLED = os.Getenv("NETPROXY_ENABLED") == "true" + var Socks5ProxyURL = url.Parse(fmt.Sprintf("socks5://%s", Socks5ProxyAddr)) + func AddHttpProxyHandler(handler HttpHandler) + func AddTcpProxyHandler(handler TcpHandler) + func CreateServerInternalErrorResp(req *http.Request, extra string) *http.Response + func HandleHttpProxy(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) + func HandleHttpProxyByExec(pod *cri.Pod, req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) + func HandleHttpProxyByNsenter(pod *cri.Pod, req *http.Request, forceIp string) (*http.Request, *http.Response) + func TcpProxy(ctx context.Context, i cri.Interface, c *cri.Container, addr string, ...) (net.Conn, error) + type CriHandle struct + Cri cri.Interface + func (h *CriHandle) Init() + func (h *CriHandle) TCPHandle(s *socks5.Server, c *net.TCPConn, r *socks5.Request) error + func (h *CriHandle) UDPHandle(s *socks5.Server, addr *net.UDPAddr, d *socks5.Datagram) error + type HttpHandler func(ctx context.Context, pod *cri.Pod, req *http.Request) (*http.Request, *http.Response, error) + type PortForwardTask struct + Addr string + func (t *PortForwardTask) Start(ctx context.Context) (string, error) + type TcpHandler func(ctx context.Context, i cri.Interface, c *cri.Container, addr string, ...) (net.Conn, error)