Address

class Address(uriHost: String, uriPort: Int, val dns: Dns, val socketFactory: <Error class: unknown class>, val sslSocketFactory: <Error class: unknown class>?, val hostnameVerifier: <Error class: unknown class>?, val certificatePinner: CertificatePinner?, val proxyAuthenticator: Authenticator, val proxy: <Error class: unknown class>?, protocols: List<Protocol>, connectionSpecs: List<ConnectionSpec>, val proxySelector: <Error class: unknown class>)

A specification for a connection to an origin server. For simple connections, this is the server's hostname and port. If an explicit proxy is requested (or Proxy.NO_PROXY is explicitly requested), this also includes that proxy information. For secure connections the address also includes the SSL socket factory, hostname verifier, and certificate pinner.

HTTP requests that share the same Address may also share the same Connection.

Constructors

Link copied to clipboard
constructor(uriHost: String, uriPort: Int, dns: Dns, socketFactory: <Error class: unknown class>, sslSocketFactory: <Error class: unknown class>?, hostnameVerifier: <Error class: unknown class>?, certificatePinner: CertificatePinner?, proxyAuthenticator: Authenticator, proxy: <Error class: unknown class>?, protocols: List<Protocol>, connectionSpecs: List<ConnectionSpec>, proxySelector: <Error class: unknown class>)

Properties

Link copied to clipboard

Returns this address's certificate pinner, or null if this is not an HTTPS address.

Link copied to clipboard
Link copied to clipboard
val dns: Dns

Returns the service that will be used to resolve IP addresses for hostnames.

Link copied to clipboard
val hostnameVerifier: <Error class: unknown class>?

Returns the hostname verifier, or null if this is not an HTTPS address.

Link copied to clipboard

The protocols the client supports. This method always returns a non-null list that contains minimally Protocol.HTTP_1_1.

Link copied to clipboard
val proxy: <Error class: unknown class>?

Returns this address's explicitly-specified HTTP proxy, or null to delegate to the proxy selector.

Link copied to clipboard

Returns the client's proxy authenticator.

Link copied to clipboard
val proxySelector: <Error class: unknown class>

Returns this address's proxy selector. Only used if the proxy is null. If none of this selector's proxies are reachable, a direct connection will be attempted.

Link copied to clipboard
val socketFactory: <Error class: unknown class>

Returns the socket factory for new connections.

Link copied to clipboard
val sslSocketFactory: <Error class: unknown class>?

Returns the SSL socket factory, or null if this is not an HTTPS address.

Link copied to clipboard

Returns a URL with the hostname and port of the origin server. The path, query, and fragment of this URL are always empty, since they are not significant for planning a route.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String