diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index 8912dbaa..cb4d0ce1 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -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) diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 01ac8569..2785a5a9 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -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