Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support for creating a proxy or reverse-proxy server
- proxyServe :: (MonadIO m, WebMonad Response m, ServerMonad m, MonadPlus m, FilterMonad Response m) => [String] -> m Response
- proxyServe' :: (MonadIO m, FilterMonad Response m, WebMonad Response m) => Request -> m Response
- rproxyServe :: (ServerMonad m, WebMonad Response m, FilterMonad Response m, MonadIO m) => String -> [(String, String)] -> m Response
- unproxify :: Request -> Request
- unrproxify :: String -> [(String, String)] -> Request -> Request
Documentation
proxyServe :: (MonadIO m, WebMonad Response m, ServerMonad m, MonadPlus m, FilterMonad Response m) => [String] -> m Response Source #
proxyServe
is for creating a part that acts as a proxy. The
sole argument [
is a list of allowed domains for
proxying. This matches the domain part of the request and the
wildcard * can be used. E.g.String
]
- "*" to match anything.
- "*.example.com" to match anything under example.com
- "example.com" to match just example.com
TODO: annoyingly enough, this method eventually calls escape
, so
any headers you set won't be used, and the computation immediately
ends.
proxyServe' :: (MonadIO m, FilterMonad Response m, WebMonad Response m) => Request -> m Response Source #
:: (ServerMonad m, WebMonad Response m, FilterMonad Response m, MonadIO m) | |
=> String | defaultHost |
-> [(String, String)] | map to look up hostname mappings. For the reverse proxy |
-> m Response | the result is a |
This is a reverse proxy implementation. See unrproxify
.
TODO: this would be more useful if it didn't call escape
, just
like proxyServe'
.