def proxy.select

bend-kit-http@0.38.2.0 · http.bend:3103

import bend-kit-http@0.38.2.0/http.bend as Http
import Base

3103def proxy.select(+scheme: String, +host: String, +port: U32) ->
3104    IO(Maybe<&2, Proxy>):
3105  +secure = String.eq(scheme, "https")
3106  do IO<Maybe<&2, Proxy>>:
3107    bypass : String <- proxy.env("no_proxy", "NO_PROXY")
3108    value : String <- proxy.env(Bool.pick(String, secure, "https_proxy", "http_proxy"),
3109      Bool.pick(String, secure, "HTTPS_PROXY", "HTTP_PROXY"))
3110    return proxy.choose(proxy.no_match(host, port, bypass), value)

Uses (12)

Used by (3)