We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import ( "context" "net" "net/http" "time" ) func main() { // create a SOCKS5 proxy dialer dialer, err := proxy.SOCKS5("tcp", "localhost:1080", nil, proxy.Direct) if err != nil { // handle error } // create a transport that uses the SOCKS5 proxy dialer transport := &http.Transport{ DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { return dialer.Dial(network, addr) }, } // create an http.Client that uses the custom transport httpClient := &http.Client{ Timeout: 10 * time.Second, Transport: transport, } // use the httpClient to make requests resp, err := httpClient.Get("https://example.com") if err != nil { // handle error } defer resp.Body.Close() // read the response body // ... }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: