Android APIs
public class

ProxyInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.net.ProxyInfo

Class Overview

Describes a proxy configuration. Proxy configurations are already integrated within the java.net and Apache HTTP stack. So URLConnection and Apache's HttpClient will use them automatically. Other HTTP stacks will need to obtain the proxy info from PROXY_CHANGE_ACTION broadcast as the extra EXTRA_PROXY_INFO.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ProxyInfo> CREATOR
Public Methods
static ProxyInfo buildDirectProxy(String host, int port)
Constructs a ProxyInfo object that points at a Direct proxy on the specified host and port.
static ProxyInfo buildDirectProxy(String host, int port, List<String> exclList)
Constructs a ProxyInfo object that points at a Direct proxy on the specified host and port.
static ProxyInfo buildPacProxy(Uri pacUri)
Construct a ProxyInfo that will download and run the PAC script at the specified URL.
boolean equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
String[] getExclusionList()
When configured to use a Direct Proxy this returns the list of hosts for which the proxy is ignored.
String getHost()
When configured to use a Direct Proxy this returns the host of the proxy.
Uri getPacFileUrl()
Returns the URL of the current PAC script or null if there is no PAC script.
int getPort()
When configured to use a Direct Proxy this returns the port of the proxy
int hashCode()
Returns an integer hash code for this object.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<ProxyInfo> CREATOR

Added in API level 21

Public Methods

public static ProxyInfo buildDirectProxy (String host, int port)

Added in API level 21

Constructs a ProxyInfo object that points at a Direct proxy on the specified host and port.

public static ProxyInfo buildDirectProxy (String host, int port, List<String> exclList)

Added in API level 21

Constructs a ProxyInfo object that points at a Direct proxy on the specified host and port. The proxy will not be used to access any host in exclusion list, exclList.

Parameters
exclList Hosts to exclude using the proxy on connections for. These hosts can use wildcards such as *.example.com.

public static ProxyInfo buildPacProxy (Uri pacUri)

Added in API level 21

Construct a ProxyInfo that will download and run the PAC script at the specified URL.

public boolean equals (Object o)

Added in API level 21

Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

The general contract for the equals and hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

Parameters
o the object to compare this instance with.
Returns
  • true if the specified object is equal to this Object; false otherwise.

public String[] getExclusionList ()

Added in API level 21

When configured to use a Direct Proxy this returns the list of hosts for which the proxy is ignored.

public String getHost ()

Added in API level 21

When configured to use a Direct Proxy this returns the host of the proxy.

public Uri getPacFileUrl ()

Added in API level 21

Returns the URL of the current PAC script or null if there is no PAC script.

public int getPort ()

Added in API level 21

When configured to use a Direct Proxy this returns the port of the proxy

public int hashCode ()

Added in API level 21

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
  • this object's hash code.

public String toString ()

Added in API level 21

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.