Permalink
Browse files

Support for http-proxy (#234)

  • Loading branch information...
1 parent 8c52a4c commit b4461f8ee50accf7446199b3486980575e3e85b4 @junjihashimoto junjihashimoto committed with Jun 19, 2017
Showing with 5 additions and 1 deletion.
  1. +5 −1 Aws/Aws.hs
View
@@ -82,6 +82,7 @@ data Configuration
, credentials :: Credentials
-- | The error / message logger.
, logger :: Logger
+ , proxy :: Maybe HTTP.Proxy
}
-- | The default configuration, with credentials loaded from environment variable or configuration file
@@ -95,6 +96,7 @@ baseConfiguration = liftIO $ do
timeInfo = Timestamp
, credentials = cr'
, logger = defaultLog Warning
+ , proxy = Nothing
}
-- | Debug configuration, which logs much more verbosely.
@@ -234,7 +236,9 @@ unsafeAwsRef cfg info manager metadataRef request = do
let !q = {-# SCC "unsafeAwsRef:signQuery" #-} signQuery request info sd
let logDebug = liftIO . logger cfg Debug . T.pack
logDebug $ "String to sign: " ++ show (sqStringToSign q)
- !httpRequest <- {-# SCC "unsafeAwsRef:httpRequest" #-} liftIO $ queryToHttpRequest q
+ !httpRequest <- {-# SCC "unsafeAwsRef:httpRequest" #-} liftIO $ do
+ req <- queryToHttpRequest q
+ return $ req { HTTP.proxy = proxy cfg }
logDebug $ "Host: " ++ show (HTTP.host httpRequest)
logDebug $ "Path: " ++ show (HTTP.path httpRequest)
logDebug $ "Query string: " ++ show (HTTP.queryString httpRequest)

0 comments on commit b4461f8

Please sign in to comment.