Langue

HttpEngine.Builder.SetProxyOptions(ProxyOptions) Method

Definition

Configures proxying behavior.

[Android.Runtime.Register("setProxyOptions", "(Landroid/net/http/ProxyOptions;)Landroid/net/http/HttpEngine$Builder;", "GetSetProxyOptions_Landroid_net_http_ProxyOptions_Handler", ApiSince=37)]
public virtual Android.Net.Http.HttpEngine.Builder SetProxyOptions(Android.Net.Http.ProxyOptions options);
[<Android.Runtime.Register("setProxyOptions", "(Landroid/net/http/ProxyOptions;)Landroid/net/http/HttpEngine$Builder;", "GetSetProxyOptions_Landroid_net_http_ProxyOptions_Handler", ApiSince=37)>]
abstract member SetProxyOptions : Android.Net.Http.ProxyOptions -> Android.Net.Http.HttpEngine.Builder
override this.SetProxyOptions : Android.Net.Http.ProxyOptions -> Android.Net.Http.HttpEngine.Builder

Parameters

options
ProxyOptions

Returns

the builder to facilitate chaining.

Attributes

Remarks

Configures proxying behavior. This affects, in different ways: connections establishment, UrlRequest and BidirectionalStream. For more details, refer to the documentation of Proxy.

This is not to be confused with proxy configuration that have been set up by: the user; or some enterprise profile configuration, or (most likely) some network autoconfiguration (e.g., Web Proxy Auto-Discovery Protocol). This is usually referred to as "system" proxy configuration. If present, respecting the system proxy configuration is often a requirement to obtain local and/or internet connectivity. HttpEngine already handles the system proxy configuration internally.

A proxy configuration defined via this API are refererred to as "app" proxy configuration. App and system proxy configuration are separate and, most importantly, differ. Currently, app and system proxy configurations are mutually exclusive: specifying ProxyOptions overrides the system proxy configuration, if present. This might cause connectivity problems in some scenarios where a system proxy configuration is present. In such scenarios, users might end up with no internet access, unless ProxyOptions has been configured with a final, null, fallback. Refer to ProxyOptions documentation.

Android reference for android.net.http.HttpEngine.Builder.setProxyOptions.

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