Safe Haskell | None |
---|
This module provides facilities for patching incoming Requests
to
correct the value of rqRemoteAddr
if the snap server is running behind a
proxy.
Example usage:
m :: Snap () m = undefined -- code goes here applicationHandler :: Snap () applicationHandler = behindProxy X_Forwarded_For m
- data ProxyType
- behindProxy :: MonadSnap m => ProxyType -> m a -> m a
Documentation
What kind of proxy is this? Affects which headers behindProxy
pulls the
original remote address from.
Currently only proxy servers that send X-Forwarded-For
or Forwarded-For
are supported.
NoProxy | no proxy, leave the request alone |
X_Forwarded_For | Use the |
behindProxy :: MonadSnap m => ProxyType -> m a -> m aSource
Rewrite rqRemoteAddr
if we're behind a proxy.