okhttp / okhttp3 / Address

Address

class Address

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 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

Name Summary
<init> 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 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.Address(uriHost:String, uriPort:Int, dns:Dns, socketFactory:SocketFactory, sslSocketFactory:SSLSocketFactory?, hostnameVerifier:HostnameVerifier?, certificatePinner:CertificatePinner?, proxyAuthenticator:Authenticator, proxy:Proxy?, protocols:List<Protocol>, connectionSpecs:List<ConnectionSpec>, proxySelector:ProxySelector)

Properties

Name Summary
certificatePinner Returns this address’s certificate pinner, or null if this is not an HTTPS address.val certificatePinner:CertificatePinner?
connectionSpecs val connectionSpecs:List<ConnectionSpec>
dns Returns the service that will be used to resolve IP addresses for hostnames.val dns:Dns
hostnameVerifier Returns the hostname verifier, or null if this is not an HTTPS address.val hostnameVerifier:HostnameVerifier?
protocols The protocols the client supports. This method always returns a non-null list that contains minimally Protocol.HTTP_1_1.val protocols:List<Protocol>
proxy Returns this address’s explicitly-specified HTTP proxy, or null to delegate to the {@linkplain #proxySelector proxy selector}.val proxy:Proxy?
proxyAuthenticator Returns the client’s proxy authenticator.val proxyAuthenticator:Authenticator
proxySelector 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.val proxySelector:ProxySelector
socketFactory Returns the socket factory for new connections.val socketFactory:SocketFactory
sslSocketFactory Returns the SSL socket factory, or null if this is not an HTTPS address.val sslSocketFactory:SSLSocketFactory?
url 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.val url:HttpUrl

Functions

Name Summary
equals fun equals(other:Any?):Boolean
hashCode fun hashCode():Int
toString fun toString():String