private static ProxyConfig toProxyConfig(@Nullable Proxy proxy) {
        if (proxy == null || proxy.address() == null) {
            return ProxyConfig.direct();
        }

        final InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address();
        switch (proxy.type()) {
            case HTTP:
                return ProxyConfig.connect(resolve(proxyAddress));
            case SOCKS:
                // NOTE: we may consider using {@code sun.net.SocksProxy} to determine the socksProxyVersion
                return ProxyConfig.socks5(resolve(proxyAddress));
            case DIRECT:
            default:
                return ProxyConfig.direct();
        }
    }
Converts {@link SessionProtocol}, {@link Endpoint} to a uri without serialization format.
core/src/main/java/com/linecorp/armeria/client/proxy/WrappingProxyConfigSelector.java