aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-10-06 14:19:44 +0200
committeradamw <adam@warski.org>2017-10-06 14:19:44 +0200
commitbb7abc189d9a5f079caa47a4508b5ae585dc8bcf (patch)
tree4d096e1b0c78156df923a7cf3282a86507b8ef8b /README.md
parent43baccc0edf12e8951c903d6697d7ee24a201e63 (diff)
downloadsttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.tar.gz
sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.tar.bz2
sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.zip
#10: add proxy support
Diffstat (limited to 'README.md')
-rw-r--r--README.md20
1 files changed, 18 insertions, 2 deletions
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