You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prox5/mrworldwide.go

25 lines
650 B

package prox5
import (
"crypto/tls"
"net/http"
)
// GetHTTPClient retrieves a pointer to an http.Client powered by MysteryDialer.
func (s *Swamp) GetHTTPClient() *http.Client {
return &http.Client{
Transport: &http.Transport{
DialContext: s.DialContext,
DisableKeepAlives: true,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSHandshakeTimeout: s.GetServerTimeout(),
},
Timeout: s.GetServerTimeout(),
}
}
// RoundTrip is Mr. WorldWide. Obviously. See: https://pkg.go.dev/net/http#RoundTripper
func (s *Swamp) RoundTrip(req *http.Request) (*http.Response, error) {
return s.GetHTTPClient().Do(req)
}