Skip to content

Commit

Permalink
Fixing a bug with proxy not being used while configured
Browse files Browse the repository at this point in the history
  • Loading branch information
kowallen committed Jul 5, 2024
1 parent 81156dc commit 76d5797
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 76d5797

Please sign in to comment.