package cohttp

  1. Overview
  2. Docs

Module Proxy.ForwardSource

Utilities for configuring and reasoning about forward proxies for client requests

Sourcetype ('direct, 'tunnel) servers

A configuration for forward proxy servers

Sourcetype ('direct, 'tunnel) t =
  1. | Direct of 'direct
    (*

    A proxy providing direct forwarding

    *)
  2. | Tunnel of 'tunnel
    (*

    A proxy using a tunnel (i.e. for https connections))

    *)

A forward proxying connection

Sourceval make_servers : no_proxy_patterns:string option -> default_proxy:Uri.t option -> scheme_proxies:(string * Uri.t) list -> direct:(Uri.t -> 'direct) -> tunnel:(Uri.t -> 'tunnel) -> ('direct, 'tunnel) servers

Create a new configuration of proxy servers

  • parameter no_proxy_patterns

    Disable proxies for specific hosts, specified as curl's NO_PROXY.

  • parameter default_proxy

    The default proxy to use. Proxy for specific schemes have precedence over this.

  • parameter scheme_proxies

    A mapping of (remote) scheme's to the desired proxy URI to user for calls with that scheme.

  • parameter direct

    A function to create 'direct connections for the given proxy URI.

  • parameter tunnel

    A function to create 'tunnel connections for the given proxy URI.

Sourceval get : ('direct, 'tunnel) servers -> Uri.t -> ('direct, 'tunnel) t option

get proxies uri finds the proxy configured for the uri, if there is one given proxies.

  • parameter servers

    The configured proxy servers

  • parameter uri

    The URI to find a proxy server for