proxy

Added in version 4.1.0b12.dev.

Type: dict

Description: Configures everything related to the proxy settings.

proxy[global]

Added in version 4.1.0b12.dev.

Type: dict

Default value: {"http": null, "https": null}

Description:

The global proxy settings to use when no rules is matching.

The proxy settings matcher works with rules, meaning that it will first try to match any of the given rules against the hostname that is being requested against. If none is matching, it will just take over proxy[global][http] and proxy[global][https].

Note

Both http and https keys are required. But, if one is missing and the other one is given, PyFunceble will take over the given one.

If you give the following - as example:

http: http://example.org:8080
https: null

The proxy settings matcher will read/use when no rules is matched:

http: http://example.org:8080
https: http://example.org:8080

proxy[rules]

Added in version 4.1.0b12.dev.

Type: list

Default value: [] (None)

Description:

Sets the list of rules the proxy settings matcher has to follow.

The proxy settings matcher will first look at the rules listed under this key.

If you give the following - as example:

proxy:
  global:
    http: http://example.de:8080
    https: http://example.de:8080
  rules:
    - http: http://example.dev:8080
      https: http://example.dev:8080
      tld:
        - com
        - org
    - http: socks5h://example.org:8080
      https: socks5h://example.org:8080
      tld:
        - onion

The proxy settings matcher will:

  • use http://example.dev:8080 for any HTTP and HTTPS requests to a subject that has the com and org Top-Level-Domain (TLD).

    Example: example.com and example.org

  • use socks5h://example.org:8080 for any HTTP and HTTPS requests to a subject that has the onion Top-Level-Domain (TLD).

    Example: example.onion

    Warning

    If you explicitly want to use this feature to be able to test .onion subjects, be sure to use the socks5h instead of socks5 protocol.

    socks5h will delegate the DNS lookup to the proxy when socks5 will delegate the DNS lookup to the locally defined DNS resolver or server.

  • use http://example.de for any HTTP and HTTPS requests to any other subject that is not matching the previous rules.