Class Address

java.lang.Object
org.miaixz.bus.http.Address

public class Address extends Object
到源服务器的连接的规范。对于简单的连接,这是服务器的主机名和端口。如果显式请求了 代理(或显式请求了no proxy)则还包括该代理信息 对于安全连接,该地址还包括SSL套接字工厂、主机名验证器和证书 共享相同的Address的HTTP请求也可能共享相同的Connection
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

  • Method Details

    • url

      public UnoUrl 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.
    • dns

      public DnsX dns()
      Returns the service that will be used to resolve IP addresses for hostnames.
    • socketFactory

      public SocketFactory socketFactory()
      Returns the socket factory for new connections.
    • proxyAuthenticator

      public Authenticator proxyAuthenticator()
      Returns the client's proxy authenticator.
    • protocols

      public List<Protocol> protocols()
      Returns the protocols the client supports. This method always returns a non-null list that contains minimally Protocol.HTTP_1_1.
    • connectionSpecs

      public List<ConnectionSuite> connectionSpecs()
    • proxySelector

      public ProxySelector 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.
    • proxy

      public Proxy proxy()
      Returns this address's explicitly-specified HTTP proxy, or null to delegate to the proxy selector.
    • sslSocketFactory

      public SSLSocketFactory sslSocketFactory()
      Returns the SSL socket factory, or null if this is not an HTTPS address.
    • hostnameVerifier

      public HostnameVerifier hostnameVerifier()
      Returns the hostname verifier, or null if this is not an HTTPS address.
    • certificatePinner

      public CertificatePinner certificatePinner()
      Returns this address's certificate pinner, or null if this is not an HTTPS address.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object