ProxyPolicy Class

A proxy policy.

Dictionary mapping protocol or protocol and host to the URL of the proxy to be used on each Request.

Inheritance
azure.core.pipeline.policies._base.SansIOHTTPPolicy
ProxyPolicy

Constructor

ProxyPolicy(proxies=None, **kwargs)

Parameters

proxies
dict
default value: None

Maps protocol or protocol and hostname to the URL of the proxy.

Examples

Configuring a proxy policy.


   from azure.core.pipeline.policies import ProxyPolicy

   proxy_policy = ProxyPolicy()

   # Example
   proxy_policy.proxies = {'http': 'http://10.10.1.10:3148'}

   # Use basic auth
   proxy_policy.proxies = {'https': 'http://user:password@10.10.1.10:1180/'}

   # You can also configure proxies by setting the environment variables
   # HTTP_PROXY and HTTPS_PROXY.

Methods

on_request

Is executed before sending the request from next policy.

on_request

Is executed before sending the request from next policy.

on_request(request: azure.core.pipeline.PipelineRequest) -> None

Parameters

request
PipelineRequest
Required

Request to be modified before sent from next policy.