commit ghc-http-reverse-proxy for openSUSE:Factory

2017-06-03 Thread root
Hello community,

here is the log from the commit of package ghc-http-reverse-proxy for 
openSUSE:Factory checked in at 2017-06-04 01:53:52

Comparing /work/SRC/openSUSE:Factory/ghc-http-reverse-proxy (Old)
 and  /work/SRC/openSUSE:Factory/.ghc-http-reverse-proxy.new (New)


Package is "ghc-http-reverse-proxy"

Sun Jun  4 01:53:52 2017 rev:4 rq:494165 version:0.4.4

Changes:

--- 
/work/SRC/openSUSE:Factory/ghc-http-reverse-proxy/ghc-http-reverse-proxy.changes
2017-04-11 09:42:38.678427691 +0200
+++ 
/work/SRC/openSUSE:Factory/.ghc-http-reverse-proxy.new/ghc-http-reverse-proxy.changes
   2017-06-04 01:54:03.285146775 +0200
@@ -1,0 +2,5 @@
+Mon Apr 24 12:33:13 UTC 2017 - psim...@suse.com
+
+- Update to version 0.4.4 with cabal2obs.
+
+---

Old:

  http-reverse-proxy-0.4.3.3.tar.gz

New:

  http-reverse-proxy-0.4.4.tar.gz



Other differences:
--
++ ghc-http-reverse-proxy.spec ++
--- /var/tmp/diff_new_pack.HnW1Wf/_old  2017-06-04 01:54:04.892919627 +0200
+++ /var/tmp/diff_new_pack.HnW1Wf/_new  2017-06-04 01:54:04.896919062 +0200
@@ -19,7 +19,7 @@
 %global pkg_name http-reverse-proxy
 %bcond_with tests
 Name:   ghc-%{pkg_name}
-Version:0.4.3.3
+Version:0.4.4
 Release:0
 Summary:Reverse proxy HTTP requests, either over raw sockets or with 
WAI
 License:BSD-3-Clause

++ http-reverse-proxy-0.4.3.3.tar.gz -> http-reverse-proxy-0.4.4.tar.gz 
++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-reverse-proxy-0.4.3.3/ChangeLog.md 
new/http-reverse-proxy-0.4.4/ChangeLog.md
--- old/http-reverse-proxy-0.4.3.3/ChangeLog.md 2017-03-13 11:19:52.0 
+0100
+++ new/http-reverse-proxy-0.4.4/ChangeLog.md   2017-04-19 18:04:39.0 
+0200
@@ -1,3 +1,8 @@
+## 0.4.4
+
+* add `rawTcpProxyTo` which can handle proxying connections without http 
headers 
+  [#21](https://github.com/fpco/http-reverse-proxy/issues/21) 
+
 ## 0.4.3.3
 
 * `fixReqHeaders` may create weird `x-real-ip` header 
[#19](https://github.com/fpco/http-reverse-proxy/issues/19)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-reverse-proxy-0.4.3.3/Network/HTTP/ReverseProxy.hs 
new/http-reverse-proxy-0.4.4/Network/HTTP/ReverseProxy.hs
--- old/http-reverse-proxy-0.4.3.3/Network/HTTP/ReverseProxy.hs 2017-03-13 
11:18:23.0 +0100
+++ new/http-reverse-proxy-0.4.4/Network/HTTP/ReverseProxy.hs   2017-04-19 
18:05:51.0 +0200
@@ -10,6 +10,7 @@
   ProxyDest (..)
   -- * Raw
 , rawProxyTo
+, rawTcpProxyTo
   -- * WAI + http-conduit
 , waiProxyTo
 , defaultOnExc
@@ -121,16 +122,36 @@
   where
 fromClient = DCN.appSource appdata
 toClient = DCN.appSink appdata
-withServer rsrc appdataServer = do
-x <- newEmptyMVar
-tid1 <- fork $ (rsrc $$+- toServer) `finally` putMVar x True
-tid2 <- fork $ (fromServer $$ toClient) `finally` putMVar x False
-y <- takeMVar x
-killThread $ if y then tid2 else tid1
+withServer rsrc appdataServer = void $ concurrently
+(rsrc $$+- toServer)
+(fromServer $$ toClient)
   where
 fromServer = DCN.appSource appdataServer
 toServer = DCN.appSink appdataServer
 
+-- | Set up a reverse tcp proxy server, which will have a minimal overhead.
+--
+-- This function uses raw sockets, parsing as little of the request as
+-- possible. The workflow is:
+--
+-- 1. Open up a connection to the given host\/port.
+--
+-- 2. Pass all bytes across the wire unchanged.
+--
+-- If you need more control, such as modifying the request or response, use 
'waiProxyTo'.
+--
+-- Since 0.4.4
+rawTcpProxyTo :: (MonadBaseControl IO m, MonadIO m)
+   => ProxyDest
+   -> AppData
+   -> m ()
+rawTcpProxyTo (ProxyDest host port) appdata = liftIO $
+DCN.runTCPClient (DCN.clientSettings port host) withServer
+  where
+withServer appdataServer = void $ concurrently
+  (DCN.appSource appdata   $$ DCN.appSink appdataServer)
+  (DCN.appSource appdataServer $$ DCN.appSink appdata  )
+
 -- | Sends a simple 502 bad gateway error message with the contents of the
 -- exception.
 defaultOnExc :: SomeException -> WAI.Application
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-reverse-proxy-0.4.3.3/http-reverse-proxy.cabal 
new/http-reverse-proxy-0.4.4/http-reverse-proxy.cabal
--- old/http-reverse-proxy-0.4.3.3/http-reverse-proxy.cabal 2017-03-13 
11:19:23.0 +0100
+++ new/http-reverse-proxy-0.4.4/http-reverse-proxy.cabal   2017-04-19 
18:04:39.0 +0200
@@ -1,5 

commit ghc-http-reverse-proxy for openSUSE:Factory

2017-04-11 Thread root
Hello community,

here is the log from the commit of package ghc-http-reverse-proxy for 
openSUSE:Factory checked in at 2017-04-11 09:42:36

Comparing /work/SRC/openSUSE:Factory/ghc-http-reverse-proxy (Old)
 and  /work/SRC/openSUSE:Factory/.ghc-http-reverse-proxy.new (New)


Package is "ghc-http-reverse-proxy"

Tue Apr 11 09:42:36 2017 rev:3 rq:485134 version:0.4.3.3

Changes:

--- 
/work/SRC/openSUSE:Factory/ghc-http-reverse-proxy/ghc-http-reverse-proxy.changes
2016-11-10 13:22:04.0 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-http-reverse-proxy.new/ghc-http-reverse-proxy.changes
   2017-04-11 09:42:38.678427691 +0200
@@ -1,0 +2,5 @@
+Mon Mar 27 12:38:39 UTC 2017 - psim...@suse.com
+
+- Update to version 0.4.3.3 with cabal2obs.
+
+---

Old:

  http-reverse-proxy-0.4.3.2.tar.gz

New:

  http-reverse-proxy-0.4.3.3.tar.gz



Other differences:
--
++ ghc-http-reverse-proxy.spec ++
--- /var/tmp/diff_new_pack.VPLh3w/_old  2017-04-11 09:42:39.310338425 +0200
+++ /var/tmp/diff_new_pack.VPLh3w/_new  2017-04-11 09:42:39.314337861 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-http-reverse-proxy
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name http-reverse-proxy
 %bcond_with tests
 Name:   ghc-%{pkg_name}
-Version:0.4.3.2
+Version:0.4.3.3
 Release:0
 Summary:Reverse proxy HTTP requests, either over raw sockets or with 
WAI
 License:BSD-3-Clause

++ http-reverse-proxy-0.4.3.2.tar.gz -> http-reverse-proxy-0.4.3.3.tar.gz 
++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-reverse-proxy-0.4.3.2/ChangeLog.md 
new/http-reverse-proxy-0.4.3.3/ChangeLog.md
--- old/http-reverse-proxy-0.4.3.2/ChangeLog.md 2016-10-27 18:16:44.0 
+0200
+++ new/http-reverse-proxy-0.4.3.3/ChangeLog.md 2017-03-13 11:19:52.0 
+0100
@@ -1,3 +1,7 @@
+## 0.4.3.3
+
+* `fixReqHeaders` may create weird `x-real-ip` header 
[#19](https://github.com/fpco/http-reverse-proxy/issues/19)
+
 ## 0.4.3.2
 
 * Minor doc cleanup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-reverse-proxy-0.4.3.2/Network/HTTP/ReverseProxy.hs 
new/http-reverse-proxy-0.4.3.3/Network/HTTP/ReverseProxy.hs
--- old/http-reverse-proxy-0.4.3.2/Network/HTTP/ReverseProxy.hs 2016-10-16 
09:35:53.0 +0200
+++ new/http-reverse-proxy-0.4.3.3/Network/HTTP/ReverseProxy.hs 2017-03-13 
11:18:23.0 +0100
@@ -58,13 +58,15 @@
 import   Data.Default.Class (Default (..), def)
 import   Data.Functor.Identity  (Identity (..))
 import   Data.IORef
-import   Data.Maybe (fromMaybe)
+import   Data.Maybe (fromMaybe, listToMaybe)
 import   Data.Monoid(mappend, mconcat, (<>))
 import   Data.Set   (Set)
 import qualified Data.Set   as Set
 import   Data.Streaming.Network (AppData, readLens)
 import qualified Data.Text.Lazy as TL
 import qualified Data.Text.Lazy.Encodingas TLE
+import qualified Data.Text  as T
+import qualified Data.Text.Encoding as TE
 import   Data.Word8 (isSpace, _colon, _cr)
 import   Network.HTTP.Client(BodyReader, brRead)
 import qualified Network.HTTP.Clientas HC
@@ -319,11 +321,14 @@
$ WAI.requestHeaders req
   where
 fromSocket = (("X-Real-IP", S8.pack $ showSockAddr $ WAI.remoteHost req):)
+fromForwardedFor = do
+  h <- lookup "x-forwarded-for" (WAI.requestHeaders req)
+  listToMaybe $ map (TE.encodeUtf8 . T.strip) $ T.splitOn "," $ 
TE.decodeUtf8 h
 addXRealIP =
 case wpsSetIpHeader wps of
 SIHFromSocket -> fromSocket
 SIHFromHeader ->
-case lookup "x-real-ip" (WAI.requestHeaders req) <|> lookup 
"X-Forwarded-For" (WAI.requestHeaders req) of
+case lookup "x-real-ip" (WAI.requestHeaders req) <|> 
fromForwardedFor of
 Nothing -> fromSocket
 Just ip -> (("X-Real-IP", ip):)
 SIHNone -> id
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-reverse-proxy-0.4.3.2/http-reverse-proxy.cabal 
new/http-reverse-proxy-0.4.3.

commit ghc-http-reverse-proxy for openSUSE:Factory

2016-11-10 Thread h_root
Hello community,

here is the log from the commit of package ghc-http-reverse-proxy for 
openSUSE:Factory checked in at 2016-11-10 13:22:02

Comparing /work/SRC/openSUSE:Factory/ghc-http-reverse-proxy (Old)
 and  /work/SRC/openSUSE:Factory/.ghc-http-reverse-proxy.new (New)


Package is "ghc-http-reverse-proxy"

Changes:

--- 
/work/SRC/openSUSE:Factory/ghc-http-reverse-proxy/ghc-http-reverse-proxy.changes
2016-11-01 09:55:44.0 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-http-reverse-proxy.new/ghc-http-reverse-proxy.changes
   2016-11-10 13:22:04.0 +0100
@@ -1,0 +2,10 @@
+Sun Oct 30 16:29:53 UTC 2016 - psim...@suse.com
+
+- Update to version 0.4.3.2 with cabal2obs.
+
+---
+Wed Aug 17 18:30:10 UTC 2016 - psim...@suse.com
+
+- Update to version 0.4.3.1 revision 0 with cabal2obs.
+
+---

Old:

  http-reverse-proxy-0.4.3.tar.gz

New:

  http-reverse-proxy-0.4.3.2.tar.gz



Other differences:
--
++ ghc-http-reverse-proxy.spec ++
--- /var/tmp/diff_new_pack.mWDJhn/_old  2016-11-10 13:22:05.0 +0100
+++ /var/tmp/diff_new_pack.mWDJhn/_new  2016-11-10 13:22:05.0 +0100
@@ -19,15 +19,14 @@
 %global pkg_name http-reverse-proxy
 %bcond_with tests
 Name:   ghc-%{pkg_name}
-Version:0.4.3
+Version:0.4.3.2
 Release:0
 Summary:Reverse proxy HTTP requests, either over raw sockets or with 
WAI
 License:BSD-3-Clause
-Group:  System/Libraries
+Group:  Development/Languages/Other
 Url:https://hackage.haskell.org/package/%{pkg_name}
 Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
 BuildRequires:  ghc-Cabal-devel
-# Begin cabal-rpm deps:
 BuildRequires:  ghc-async-devel
 BuildRequires:  ghc-blaze-builder-devel
 BuildRequires:  ghc-bytestring-devel
@@ -55,7 +54,6 @@
 BuildRequires:  ghc-http-conduit-devel
 BuildRequires:  ghc-warp-devel
 %endif
-# End cabal-rpm deps
 
 %description
 Provides a simple means of reverse-proxying HTTP requests. The raw approach
@@ -77,20 +75,14 @@
 %prep
 %setup -q -n %{pkg_name}-%{version}
 
-
 %build
 %ghc_lib_build
 
-
 %install
 %ghc_lib_install
 
-
 %check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
 
 %post devel
 %ghc_pkg_recache

++ http-reverse-proxy-0.4.3.tar.gz -> http-reverse-proxy-0.4.3.2.tar.gz 
++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/http-reverse-proxy-0.4.3/ChangeLog.md 
new/http-reverse-proxy-0.4.3.2/ChangeLog.md
--- old/http-reverse-proxy-0.4.3/ChangeLog.md   2015-11-19 09:48:32.0 
+0100
+++ new/http-reverse-proxy-0.4.3.2/ChangeLog.md 2016-10-27 18:16:44.0 
+0200
@@ -1,3 +1,11 @@
+## 0.4.3.2
+
+* Minor doc cleanup
+
+## 0.4.3.1
+
+* Use CPP so we can work with `http-client` pre and post 0.5 
[#17](https://github.com/fpco/http-reverse-proxy/pull/17)
+
 ## 0.4.3
 
 * Allow proxying to HTTPS servers. 
[#15](https://github.com/fpco/http-reverse-proxy/pull/15)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/http-reverse-proxy-0.4.3/Network/HTTP/ReverseProxy.hs 
new/http-reverse-proxy-0.4.3.2/Network/HTTP/ReverseProxy.hs
--- old/http-reverse-proxy-0.4.3/Network/HTTP/ReverseProxy.hs   2015-11-19 
09:48:32.0 +0100
+++ new/http-reverse-proxy-0.4.3.2/Network/HTTP/ReverseProxy.hs 2016-10-16 
09:35:53.0 +0200
@@ -4,6 +4,7 @@
 {-# LANGUAGE ScopedTypeVariables   #-}
 {-# LANGUAGE LambdaCase#-}
 {-# LANGUAGE TupleSections #-}
+{-# LANGUAGE CPP   #-}
 module Network.HTTP.ReverseProxy
 ( -- * Types
   ProxyDest (..)
@@ -181,8 +182,7 @@
 -- the proxied server. Not all servers necessarily support chunked request
 -- bodies, so please confirm that yours does (Warp, Snap, and Happstack, for 
example, do).
 waiProxyTo :: (WAI.Request -> IO WaiProxyResponse)
-   -- ^ How to reverse proxy. A @Left@ result will be sent verbatim as
-   -- the response, whereas @Right@ will cause a reverse proxy.
+   -- ^ How to reverse proxy.
-> (SomeException -> WAI.Application)
-- ^ How to handle exceptions when calling remote server. For a
-- simple 502 error page, use 'defaultOnExc'.
@@ -353,8 +353,18 @@
 case edest of
 Left app -> maybe id timeBound (lpsTimeBound lps) $ app req0 
sendResponse
 Right (ProxyDest host port, req, secure) -> tryWebSockets wps host 
port req sendResponse $ do
-let req' = def
-{ HC.method = WAI.requestMethod req
+let req' =
+#if