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 --- .../asynchttpclient/monix/AsyncHttpClientMonixBackend.scala | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'async-http-client-backend/monix') diff --git a/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala b/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala index c08c244..9cb44f2 100644 --- a/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala +++ b/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala @@ -6,6 +6,7 @@ import com.softwaremill.sttp.{ FollowRedirectsBackend, MonadAsyncError, SttpBackend, + SttpBackendOptions, Utf8, concatByteBuffers } @@ -20,7 +21,6 @@ import org.asynchttpclient.{ } import org.reactivestreams.Publisher -import scala.concurrent.duration.FiniteDuration import scala.util.{Failure, Success} class AsyncHttpClientMonixBackend private ( @@ -62,13 +62,11 @@ object AsyncHttpClientMonixBackend { * @param s The scheduler used for streaming request bodies. Defaults to the * global scheduler. */ - def apply(connectionTimeout: FiniteDuration = - SttpBackend.DefaultConnectionTimeout)( + def apply(options: SttpBackendOptions = SttpBackendOptions.Default)( implicit s: Scheduler = Scheduler.Implicits.global) : SttpBackend[Task, Observable[ByteBuffer]] = - AsyncHttpClientMonixBackend( - AsyncHttpClientBackend.defaultClient(connectionTimeout.toMillis.toInt), - closeClient = true) + AsyncHttpClientMonixBackend(AsyncHttpClientBackend.defaultClient(options), + closeClient = true) /** * @param s The scheduler used for streaming request bodies. Defaults to the -- cgit v1.2.3