Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type HttpHandler
- type PortForwardTask
- type TcpHandler
Constants ¶
View Source
const ( DefaultDialTimeout = 2 * time.Second DefaultSocketTimeout = 3 * time.Minute )
View Source
const (
HttpProxyAddr = "127.0.0.1:9118"
)
View Source
const (
Socks5ProxyAddr = "127.0.0.1:9119"
)
Variables ¶
View Source
var ( NETPROXY_ENABLED = os.Getenv("NETPROXY_ENABLED") == "true" HttpProxyURL, _ = url.Parse(fmt.Sprintf("http://%s", HttpProxyAddr)) )
View Source
var (
Socks5ProxyURL, _ = url.Parse(fmt.Sprintf("socks5://%s", Socks5ProxyAddr))
)
Functions ¶
func AddHttpProxyHandler ¶
func AddHttpProxyHandler(handler HttpHandler)
func AddTcpProxyHandler ¶
func AddTcpProxyHandler(handler TcpHandler)
func HandleHttpProxy ¶
func HandleHttpProxyByExec ¶
Types ¶
type CriHandle ¶
CriHandle implements socks5.Handler interface
type HttpHandler ¶
type PortForwardTask ¶
type PortForwardTask struct {
Addr string
}
Click to show internal directories.
Click to hide internal directories.