Język

ProxyOptions.FromProxyList(IList<Proxy>, Int32) Method

Definition

Constructs a proxy configuration out of a list of Proxy.

[Android.Runtime.Register("fromProxyList", "(Ljava/util/List;I)Landroid/net/http/ProxyOptions;", "", ApiSince=37)]
public static Android.Net.Http.ProxyOptions FromProxyList(System.Collections.Generic.IList<Android.Net.Http.Proxy> proxyList, int allProxiesFailedBehavior);
[<Android.Runtime.Register("fromProxyList", "(Ljava/util/List;I)Landroid/net/http/ProxyOptions;", "", ApiSince=37)>]
static member FromProxyList : System.Collections.Generic.IList<Android.Net.Http.Proxy> * int -> Android.Net.Http.ProxyOptions

Parameters

proxyList
IList<Proxy>

The list of Proxy that defines this configuration. This value cannot be null.

allProxiesFailedBehavior
Int32

How HttpEngine must behave after it has failed to use all proxies in proxyList. Value is one of the following: ALL_PROXIES_FAILED_BEHAVIOR_DISALLOW_DIRECT; ALL_PROXIES_FAILED_BEHAVIOR_ALLOW_DIRECT

Returns

Attributes

Remarks

Constructs a proxy configuration out of a list of Proxy.

Proxies in the list will be used in order. Proxy in position N+1 will be used only if HttpEngine failed to use proxy in position N. If proxy in position N fails, for any reason (including tunnel closures triggered via Proxy.HttpConnectCallback), but proxy in position N+1 succeeds, proxies in position N will be temporarily deprioritized. While a proxy is deprioritized it will be used only as a last resort.

Android reference for android.net.http.ProxyOptions.fromProxyList.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to