@UnstableApi
    public static Endpoint of(SocketAddress addr) {
        requireNonNull(addr, "addr");
        if (addr instanceof io.netty.channel.unix.DomainSocketAddress) {
            addr = DomainSocketAddress.of((io.netty.channel.unix.DomainSocketAddress) addr);
        }

        if (addr instanceof DomainSocketAddress) {
            final DomainSocketAddress domainSocketAddr = (DomainSocketAddress) addr;
            final Endpoint endpoint = new Endpoint(Type.DOMAIN_SOCKET, domainSocketAddr.authority(),
                                                   DOMAIN_SOCKET_IP, DOMAIN_SOCKET_PORT,
                                                   DEFAULT_WEIGHT, null);
            endpoint.socketAddress = domainSocketAddr;
            return endpoint;
        }

        checkArgument(addr instanceof InetSocketAddress,
                      "unsupported address: %s", addr);

        final InetSocketAddress inetAddr = (InetSocketAddress) addr;
        final String ipAddr = inetAddr.isUnresolved() ? null : inetAddr.getAddress().getHostAddress();
        final Endpoint endpoint = of(inetAddr.getHostString(), inetAddr.getPort()).withIpAddr(ipAddr);
        if (endpoint.host.equals(inetAddr.getHostString())) {
            // Cache only when the normalized host name is the same as the original host name.
            endpoint.socketAddress = inetAddr;
        }
        return endpoint;
    }
Creates a new {@link Endpoint} from the specified {@link SocketAddress}.
This method converts the following address types into an endpoint:
<ul>
  <li>{@link InetSocketAddress}</li>
  <li>{@link DomainSocketAddress}</li>
  <li>{@link io.netty.channel.unix.DomainSocketAddress}</li>
</ul>

@throws IllegalArgumentException if the specified {@link SocketAddress} is not supported
core/src/main/java/com/linecorp/armeria/client/Endpoint.java