From bb7abc189d9a5f079caa47a4508b5ae585dc8bcf Mon Sep 17 00:00:00 2001 From: adamw Date: Fri, 6 Oct 2017 14:19:44 +0200 Subject: #10: add proxy support --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2429332..f998283 100644 --- a/README.md +++ b/README.md @@ -489,8 +489,9 @@ How to use: import com.softwaremill.sttp._ import scala.concurrent.duration._ -// all backends provide a constructor that allows users to specify connection timeout -implicit val backend = HttpURLConnectionBackend(connectionTimeout = 1.minute) +// all backends provide a constructor that allows users to specify backend options +implicit val backend = HttpURLConnectionBackend( + options = SttpBackendOptions.connectionTimeout(1.minute)) sttp .get(uri"...") @@ -498,6 +499,21 @@ sttp .send() ``` +## Proxy + +A proxy can be specified when creating a backend: + +```scala +import com.softwaremill.sttp._ + +implicit val backend = HttpURLConnectionBackend( + options = SttpBackendOptions.httpProxy("some.host", 8080)) + +sttp + .get(uri"...") + .send() // uses the proxy +``` + ## SSL SSL handling can be customized (or disabled) when creating a backend and is -- cgit v1.2.3