Network.HTTP.Proxy
Description
This module contains a simple HTTP and HTTPS proxy. In the most basic setup, the caller specifies a port and runs it as follows:
-- Run a HTTPS and HTTPS proxy on port 3128. import Network.HTTP.Proxy main :: IO () main = runProxy 3128
- runProxy :: Port -> IO ()
- runProxySettings :: Settings -> IO ()
- data Settings = Settings {
- proxyPort :: Int
- proxyHost :: String
- proxyOnException :: SomeException -> IO ()
- proxyTimeout :: Int
- proxyRequestModifier :: Request -> IO Request
- defaultSettings :: Settings
- data Request = Request {}
Documentation
runProxy :: Port -> IO ()Source
Run a HTTP and HTTPS proxy server on the specified port. This calls
runProxySettings
with defaultSettings
.
runProxySettings :: Settings -> IO ()Source
Run a HTTP and HTTPS proxy server with the specified settings.
Various proxy server settings. This is purposely kept as an abstract data
type so that new settings can be added without breaking backwards
compatibility. In order to create a Settings
value, use defaultSettings
and record syntax to modify individual records. For example:
defaultSettings { proxyPort = 3128 }
Constructors
Settings | |
Fields
|
defaultSettings :: SettingsSource
The default settings for the Proxy server. See the individual settings for the default value.
data Request
Information on the request sent by the client. This abstracts away the details of the underlying implementation.
Constructors
Request | |
Fields
|