diff --git a/hack2-contrib.cabal b/hack2-contrib.cabal
--- a/hack2-contrib.cabal
+++ b/hack2-contrib.cabal
@@ -1,5 +1,5 @@
 Name:                 hack2-contrib
-Version:              2011.6.10
+Version:              2011.6.13
 Build-type:           Simple
 Synopsis:             Hack2 contrib
 Description:          Common middlewares and utilities that helps working with Hack2
@@ -59,6 +59,7 @@
                     Hack2.Contrib.Middleware.UserMime
                     -- Hack2.Contrib.Middleware.UTF8Body
                     Hack2.Contrib.Middleware.Cascade
+                    Hack2.Contrib.Middleware.XForwardedForToRemoteHost
                     Hack2.Contrib.Mime
                     Hack2.Contrib.Request
                     Hack2.Contrib.Response
diff --git a/src/Hack2/Contrib/Middleware/XForwardedForToRemoteHost.hs b/src/Hack2/Contrib/Middleware/XForwardedForToRemoteHost.hs
new file mode 100644
--- /dev/null
+++ b/src/Hack2/Contrib/Middleware/XForwardedForToRemoteHost.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Hack2.Contrib.Middleware.XForwardedForToRemoteHost (x_forwarded_for_to_remote_host) where
+
+import Hack2
+import Air.Env
+import Prelude ()
+import Data.ByteString.Lazy.Char8 ()
+
+x_forwarded_for_to_remote_host :: Middleware
+x_forwarded_for_to_remote_host app = \env ->
+  case env.httpHeaders.lookup "x-forwarded-for" of
+    Nothing -> app env
+    Just ip -> 
+      let newHackHeaders = ("RemoteHost", ip) : env.hackHeaders
+      in
+      
+      app - env {hackHeaders = newHackHeaders}
diff --git a/src/Hack2/Contrib/Utils.hs b/src/Hack2/Contrib/Utils.hs
--- a/src/Hack2/Contrib/Utils.hs
+++ b/src/Hack2/Contrib/Utils.hs
@@ -23,7 +23,8 @@
 
 -- | usage: app.use [content_type, cache]
 use :: [Middleware] -> Middleware
-use = reduce (<<<)
+use [] = id
+use xs = xs.reduce (<<<)
 
 -- use the get / put helper to deal with headers
 put :: (Eq a) => a -> b -> [(a, b)] -> [(a, b)]
