fed prxy support
diff --git a/init.go b/init.go index 20d6478..0dad568 100644 --- a/init.go +++ b/init.go
@@ -17,9 +17,12 @@ import ( "fmt" "github.com/apid/apid-core" + "github.com/apid/apid-core/util" "os" "path/filepath" "sync" + "net/http" + "time" ) const ( @@ -63,6 +66,7 @@ events apid.EventsService unsafeDB apid.DB dbMux sync.RWMutex + client *http.Client localAnalyticsBaseDir string localAnalyticsTempDir string @@ -182,6 +186,11 @@ // set default config for internal buffer size config.SetDefault(analyticsBufferChannelSize, analyticsBufferChannelSizeDefault) + client = &http.Client{ + Transport: util.Transport(config.GetString(configfwdProxyPortURL)), + //set default timeout of 60 seconds while connecting to s3/GCS + Timeout: time.Duration(60 * time.Second), + } return nil }
diff --git a/uploader.go b/uploader.go index c37a257..e77fd0b 100644 --- a/uploader.go +++ b/uploader.go
@@ -26,13 +26,10 @@ ) const timestampLayout = "20060102150405" // same as yyyyMMddHHmmss - +const configfwdProxyPortURL = "configcompletefwdp" var token string -var client *http.Client = &http.Client{ - //set default timeout of 60 seconds while connecting to s3/GCS - Timeout: time.Duration(60 * time.Second), -} + func addHeaders(req *http.Request) { token = config.GetString("apigeesync_bearer_token")