On this page:
Proxy
Proxy.http
Proxy.https
8.16.0.4

8 Proxy Configuration🔗ℹ

class

class Proxy():

  constructor (

    ~matches: matches :: url.URL -> Boolean,

    ~connect: connect :: (HTTPConn, url.URL, maybe(SSLContext)) -> Void

  )

 

function

fun Proxy.http(

  ~proxy_url: proxy_url :: String || Bytes || url.URL,

  ~matches: matches :: url.URL -> Boolean:

              fun (u :: url.URL): u.scheme == "http"

) :: Proxy

 

function

fun Proxy.https(

  ~proxy_url: proxy_url :: String || Bytes || url.URL,

  ~matches: matches :: url.URL -> Boolean:

              = fun (u :: url.URL): u.scheme == "https"

) :: Proxy

A Proxy represents a configuration for constructing a Session that causes some connections to be created through the proxy. In general, a Proxy has a matches function to determine whether a request address should use the proxy, and a connect function that creates the proxied connection.

The Proxy.http configuration specifies an HTTP CONNECT proxy at the given proxy_url and optionally with a matches function.

The Proxy.https configuration is similar to Proxy.http, but using HTTPS.