Route

class Route(val address: Address, val proxy: Proxy, val socketAddress: InetSocketAddress)

The concrete route used by a connection to reach an abstract origin server. When creating a connection the client has many options:

  • HTTP proxy: a proxy server may be explicitly configured for the client. Otherwise, the proxy selector is used. It may return multiple proxies to attempt.

  • IP address: whether connecting directly to an origin server or a proxy, opening a socket requires an IP address. The DNS server may return multiple IP addresses to attempt.

Each route is a specific selection of these options.

Constructors

Link copied to clipboard
constructor(address: Address, proxy: Proxy, socketAddress: InetSocketAddress)

Properties

Link copied to clipboard
@get:JvmName(name = "address")
val address: Address
Link copied to clipboard
@get:JvmName(name = "proxy")
val proxy: Proxy

Returns the Proxy of this route.

Link copied to clipboard
@get:JvmName(name = "socketAddress")
val socketAddress: InetSocketAddress

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

Returns true if this route tunnels HTTPS or HTTP/2 through an HTTP proxy. See RFC 2817, Section 5.2.

Link copied to clipboard
open override fun toString(): String

Returns a string with the URL hostname, socket IP address, and socket port, like one of these: