Proxy supportΒΆ

sttp library by default checks for your System proxy properties (docs):

Following settings are checked:

  1. socksProxyHost and socksProxyPort (default: 1080)
  2. http.proxyHost and http.proxyPort (default: 80)
  3. https.proxyHost and https.proxyPort (default: 443)

Settings are loaded in given order and the first existing value is being used.

Otherwise, proxy values can be specified manually when creating a backend:

import sttp.client3._

val backend = HttpURLConnectionBackend(
  options = SttpBackendOptions.httpProxy("", 8080))

  .send(backend) // uses the proxy

Or in case your proxy requires authentication (supported by the JVM backends):

import sttp.client3._

SttpBackendOptions.httpProxy("", 8080, "username", "password")