http-reverse-proxy 0.3.1.1 → 0.3.1.2
raw patch · 2 files changed
+13/−6 lines, 2 filesdep −basic-preludedep ~network-conduit
Dependencies removed: basic-prelude
Dependency ranges changed: network-conduit
Files
- Network/HTTP/ReverseProxy.hs +11/−4
- http-reverse-proxy.cabal +2/−2
Network/HTTP/ReverseProxy.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, NoImplicitPrelude, FlexibleContexts, ScopedTypeVariables #-}+{-# LANGUAGE OverloadedStrings, FlexibleContexts, ScopedTypeVariables #-} {-# LANGUAGE CPP #-} module Network.HTTP.ReverseProxy ( -- * Types@@ -25,7 +25,6 @@ -} ) where -import BasicPrelude import Data.Conduit import Data.Default.Class (def) import qualified Network.Wai as WAI@@ -54,6 +53,14 @@ #else import Blaze.ByteString.Builder (Builder) #endif+import Data.ByteString (ByteString)+import Control.Monad.IO.Class (MonadIO, liftIO)+import Control.Monad (unless, void)+import Data.Int (Int64)+import Data.Monoid (mappend, (<>), mconcat)+import Control.Exception.Lifted (try, SomeException, finally)+import Control.Applicative ((<$>), (<|>))+import Data.Set (Set) -- | Host\/port combination to which we want to proxy. data ProxyDest = ProxyDest@@ -110,7 +117,7 @@ defaultOnExc exc _ = return $ WAI.responseLBS HT.status502 [("content-type", "text/plain")]- ("Error connecting to gateway:\n\n" ++ TLE.encodeUtf8 (TL.fromStrict $ show exc))+ ("Error connecting to gateway:\n\n" <> TLE.encodeUtf8 (TL.pack $ show exc)) -- | The different responses that could be generated by a @waiProxyTo@ lookup -- function.@@ -325,7 +332,7 @@ where close = leftover bs >> return bs where- bs = front empty+ bs = front S8.empty push bs' | "\r\n\r\n" `S8.isInfixOf` bs || "\n\n" `S8.isInfixOf` bs
http-reverse-proxy.cabal view
@@ -1,5 +1,5 @@ name: http-reverse-proxy-version: 0.3.1.1+version: 0.3.1.2 synopsis: Reverse proxy HTTP requests, either over raw sockets or with WAI description: Provides a simple means of reverse-proxying HTTP requests. The raw approach uses the same technique as leveraged by keter, whereas the WAI approach performs full request/response parsing via WAI and http-conduit. homepage: https://github.com/fpco/http-reverse-proxy@@ -26,7 +26,6 @@ , blaze-builder >= 0.3 , http-client >= 0.1 , wai >= 2.0- , basic-prelude >= 0.3.5 , network , conduit >= 0.5 , data-default-class@@ -34,6 +33,7 @@ , resourcet , containers , async+ , transformers test-suite test type: exitcode-stdio-1.0