Created
August 2, 2016 08:56
-
-
Save jakexks/2f876697dfca1fe15b92f7bb6032780d to your computer and use it in GitHub Desktop.
Proxy in AWS SDK GO
This file contains 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, | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this if you want to send files to
fakes3