-
-
Save ivankatliarchuk/c36dfd4d4d731fdc2ed669e4e845b8b5 to your computer and use it in GitHub Desktop.
Proxy in AWS SDK GO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"net/http" | |
"net/url" | |
) | |
func main() { | |
httpclient := &http.Client{ | |
Transport: &http.Transport{ | |
Proxy: func(*http.Request) (*url.URL, error) { | |
return url.Parse("http://user:pass@proxy:8080") // Or your own implementation that decides a proxy based on the URL in the request | |
}, | |
}, | |
} | |
s := session.New(&aws.Config{ | |
Region: aws.String("eu-west-1"), | |
HTTPClient: httpclient, | |
}) | |
} |
Author
ivankatliarchuk
commented
Feb 15, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment