Merge pull request #945 from paul-rouse/master

Disregard proxy environment variables in yesod devel
This commit is contained in:
Michael Snoyman 2015-03-01 13:35:31 +02:00
commit a2da368697
2 changed files with 8 additions and 0 deletions

View File

@ -68,6 +68,9 @@ import Data.Streaming.Network (bindPortTCP)
import Network (withSocketsDo)
import Network.HTTP.Conduit (conduitManagerSettings, newManager)
import Data.Default.Class (def)
#if MIN_VERSION_http_client(0,4,7)
import Network.HTTP.Client (managerSetProxy, noProxy)
#endif
import Network.HTTP.ReverseProxy (ProxyDest (ProxyDest),
waiProxyToSettings, wpsTimeout, wpsOnExc)
import qualified Network.HTTP.ReverseProxy as ReverseProxy
@ -124,7 +127,11 @@ cabalProgram opts | isCabalDev opts = "cabal-dev"
-- 3001, give an appropriate message to the user.
reverseProxy :: DevelOpts -> I.IORef Int -> IO ()
reverseProxy opts iappPort = do
#if MIN_VERSION_http_client(0,4,7)
manager <- newManager $ managerSetProxy noProxy conduitManagerSettings
#else
manager <- newManager conduitManagerSettings
#endif
let refreshHtml = LB.fromChunks $ return $(embedFile "refreshing.html")
let onExc _ req
| maybe False (("application/json" `elem`) . parseHttpAccept)

View File

@ -78,6 +78,7 @@ executable yesod
, http-reverse-proxy >= 0.4
, network
, http-conduit >= 2.1.4
, http-client
, project-template >= 0.1.1
, transformers
, transformers-compat