Skip to content

Commit c21a6ad

Browse files
committed
Allow passing in a Proxy instance.
1 parent 545c83d commit c21a6ad

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

README-CHANGES.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@
4444
</c:change>
4545
</c:changes>
4646
</c:release>
47-
<c:release date="2024-11-18T12:58:48+00:00" is-open="false" ticket-system="org.lyrasis.jira" version="1.7.0">
47+
<c:release date="2024-11-18T00:00:00+00:00" is-open="false" ticket-system="org.lyrasis.jira" version="1.7.0">
4848
<c:changes>
4949
<c:change date="2024-11-18T00:00:00+00:00" summary="Enable core library desugaring."/>
5050
</c:changes>
5151
</c:release>
52+
<c:release date="2025-06-09T17:52:04+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="1.8.0">
53+
<c:changes>
54+
<c:change date="2025-06-09T17:52:04+00:00" summary="Allow passing in a Proxy instance."/>
55+
</c:changes>
56+
</c:release>
5257
</c:releases>
5358
<c:ticket-systems>
5459
<c:ticket-system default="true" id="org.lyrasis.jira" url="https://ebce-lyrasis.atlassian.net/browse/"/>

org.librarysimplified.http.api/src/main/java/org/librarysimplified/http/api/LSHTTPClientConfiguration.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.librarysimplified.http.api
22

3+
import java.net.Proxy
34
import java.util.concurrent.TimeUnit
45

56
/**
@@ -31,4 +32,10 @@ data class LSHTTPClientConfiguration(
3132
*/
3233

3334
val timeout: Pair<Long, TimeUnit> = Pair(1L, TimeUnit.MINUTES),
35+
36+
/**
37+
* An optional proxy.
38+
*/
39+
40+
val proxy: Proxy = Proxy.NO_PROXY,
3441
)

org.librarysimplified.http.vanilla/src/main/java/org/librarysimplified/http/vanilla/internal/LSHTTPClient.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class LSHTTPClient(
4747
builder.addNetworkInterceptor(LSHTTPRedirectRequestInterceptor(modifier))
4848
builder.addNetworkInterceptor(LSHTTPLoggingInterceptor(this.logger))
4949
builder.eventListenerFactory(LSHTTPTimingEventListenerFactory)
50+
builder.proxy(configuration.proxy)
5051

5152
val timeout = this.configuration.timeout
5253
builder.callTimeout(timeout.first, timeout.second)

0 commit comments

Comments
 (0)