Skip to content

Commit

Permalink
Merge pull request #65 from celonis/fix/DP-0000-proxy_bug
Browse files Browse the repository at this point in the history
Fixing a bug with proxy not being used while configured
  • Loading branch information
kowallen authored Jul 5, 2024
2 parents 81156dc + 76d5797 commit 63cd7d5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ case class ProxiedHttpClientConfig(
new Proxy(proxyType.javaProxyType, proxyAddr)
}

override def customiseHttpClient(builder: OkHttpClient.Builder): OkHttpClient.Builder =
override def customiseHttpClient(builder: OkHttpClient.Builder): OkHttpClient.Builder = {
builder.proxy(createProxyServer())
authentication match {
case Some(auth) if javaProxyType == JavaProxyType.HTTP => configureHttpProxyAuth(builder, auth)
case Some(auth) if javaProxyType == JavaProxyType.SOCKS => configureSocksProxyAuth(auth); builder
case _ => builder
}
}

private def configureSocksProxyAuth(auth: BasicAuthentication): Unit =
JavaAuthenticator.setDefault(
Expand Down

0 comments on commit 63cd7d5

Please sign in to comment.