Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ClientTransport = &http.Transport{ DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { pretty.Println(ctx, network, addr) tcpAddr, err := net.ResolveTCPAddr(network, "127.0.0.1:8888") if err != nil { return nil, err } conn, err := net.DialTCP(network, nil, tcpAddr) if err != nil { return nil, err } conn.Write([]byte( "CONNECT 127.0.0.1:8889 HTTP/1.1\r\n" + "Host: 127.0.0.1:8889\r\n" + "Connection: Close\r\n" + "\r\n", )) pass(conn) conn.Write([]byte( "CONNECT " + addr + " HTTP/1.1\r\n" + "Host: " + addr + "\r\n" + "Connection: Close\r\n" + "\r\n", )) pass(conn) return conn, nil }, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, } ClientCookieJar, _ = cookiejar.New( &cookiejar.Options{ PublicSuffixList: &jarList{}, }, ) Client = &http.Client{ Transport: ClientTransport, CheckRedirect: func(req *http.Request, via []*http.Request) error { if len(via) >= 10 { return errors.New("stopped after 10 redirects") } return nil }, Jar: ClientCookieJar, Timeout: 0, } )
Client for Tunnel
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.