Skip to content

[Feature Request] Add support for configuring a proxy against the httpClient used by Databricks #111

@Hidoshi1

Description

@Hidoshi1

Currently DatabricksConfig allows setting the httpClient, but I am unable to initialize a com.databricks.sdk.core.http.HttpClient instance, let alone one with a proxy. It would be extra nice if we could configure the proxy for each http scheme. I would like to explicitly force proxy type HTTP, similar to this code:

import java.net.http.HttpClient

    private fun getWhitelistProxyHttpClient(): HttpClient {
        val proxyAddress = InetSocketAddress(proxyHost, proxyPort)

        val proxySelector = object : ProxySelector() {
            override fun select(uri: URI): List<Proxy> {
                return listOf(Proxy(Proxy.Type.HTTP, proxyAddress))
            }

            override fun connectFailed(uri: URI?, sa: SocketAddress?, ioe: IOException?) {
                log.error { "Proxy connection failed: $uri $sa $ioe" }
            }
        }

        return HttpClient.newBuilder()
            .version(HttpClient.Version.HTTP_2)
            .proxy(proxySelector)
            .build()
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions