http-proxy-0.1.1.0: A library for writing HTTP and HTTPS proxies

Safe HaskellNone
LanguageHaskell2010

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
Synopsis

Documentation

type Port = Int Source #

data Request Source #

 

Constructors

Request 

Fields

Instances
Eq Request Source # 
Instance details

Defined in Network.HTTP.Proxy.Request

Methods

(==) :: Request -> Request -> Bool #

(/=) :: Request -> Request -> Bool #

Show Request Source # 
Instance details

Defined in Network.HTTP.Proxy.Request

data Settings Source #

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 defaultProxySettings and record syntax to modify individual records. For example:

defaultProxySettings { proxyPort = 3128 }

Constructors

Settings 

Fields

data UpstreamProxy Source #

A http-proxy can be configured to use and upstream proxy by providing the proxy name, the port it listens to and an option username and password for proxy authorisation.

Constructors

UpstreamProxy 

Fields

runProxy :: Port -> IO () Source #

Run a HTTP and HTTPS proxy server on the specified port. This calls runProxySettings with defaultProxySettings.

runProxySettings :: Settings -> IO () Source #

Run a HTTP and HTTPS proxy server with the specified settings.

runProxySettingsSocket :: Settings -> Socket -> IO () Source #

Run a HTTP and HTTPS proxy server with the specified settings but provide it with a Socket to accept connections on. The Socket should have already have had bind and listen called on it so that the proxy can simple accept connections.

defaultProxySettings :: Settings Source #

The default settings for the Proxy server. See the individual settings for the default value.