Skip to content

Commit 64f62a9

Browse files
committed
refactor: replace default network client with OkHttp and adjust proxy support setup
- Updated build scripts to use `network-client-okhttp` by default where appropriate. - Revised README to simplify proxy setup instructions. - Adjusted integration workflows to correctly configure HTTP client preferences.
1 parent 4f354a8 commit 64f62a9

4 files changed

Lines changed: 11 additions & 21 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- main
99

1010
jobs:
11-
check-rest:
11+
check-rest-httpurlconnection:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
@@ -24,15 +24,15 @@ jobs:
2424
- name: Set up Gradle
2525
uses: gradle/actions/setup-gradle@v3
2626

27-
- run: ./gradlew :java:testRestSuite
27+
- run: ./gradlew :java:testRestSuite -PhttpURLConnection
2828

2929
- uses: actions/upload-artifact@v4
3030
if: always()
3131
with:
3232
name: java-build-reports-rest
3333
path: java/build/reports/
3434

35-
check-realtime:
35+
check-realtime-httpurlconnection:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
4848
- name: Set up Gradle
4949
uses: gradle/actions/setup-gradle@v3
5050

51-
- run: ./gradlew :java:testRealtimeSuite
51+
- run: ./gradlew :java:testRealtimeSuite -PhttpURLConnection
5252

5353
- uses: actions/upload-artifact@v4
5454
if: always()
@@ -71,7 +71,7 @@ jobs:
7171
- name: Set up Gradle
7272
uses: gradle/actions/setup-gradle@v3
7373

74-
- run: ./gradlew :java:testRestSuite -Pokhttp
74+
- run: ./gradlew :java:testRestSuite
7575

7676
check-realtime-okhttp:
7777
runs-on: ubuntu-latest
@@ -89,7 +89,7 @@ jobs:
8989
- name: Set up Gradle
9090
uses: gradle/actions/setup-gradle@v3
9191

92-
- run: ./gradlew :java:testRealtimeSuite -Pokhttp
92+
- run: ./gradlew :java:testRealtimeSuite
9393

9494
check-liveobjects:
9595
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,7 @@ You can add proxy support to the Ably Java SDK by configuring `ProxyOptions` in
134134
<details>
135135
<summary>Proxy support setup details.</summary>
136136

137-
To enable proxy support for both REST and Realtime clients in the Ably SDK, use the OkHttp library to handle HTTP requests and WebSocket connections.
138-
139-
Add the following dependency to your `build.gradle` file:
140-
141-
```groovy
142-
dependencies {
143-
runtimeOnly("io.ably:network-client-okhttp:1.4.2")
144-
}
145-
```
146-
147-
After adding the OkHttp dependency, enable proxy support by specifying proxy settings in the ClientOptions when initializing your Ably client.
137+
Enable proxy support by specifying proxy settings in the ClientOptions when initializing your Ably client.
148138

149139
The following example sets up a proxy using the Pub/Sub Java SDK:
150140

android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dependencies {
5454
compileOnly(libs.jetbrains)
5555
testImplementation(libs.bundles.tests)
5656
implementation(project(":network-client-core"))
57-
runtimeOnly(project(":network-client-default"))
57+
runtimeOnly(project(":network-client-okhttp"))
5858
implementation(libs.firebase.messaging)
5959
androidTestImplementation(libs.bundles.instrumental.android)
6060
}

java/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ dependencies {
2222
implementation(libs.bundles.common)
2323
compileOnly(libs.jetbrains)
2424
implementation(project(":network-client-core"))
25-
if (findProperty("okhttp") == null) {
26-
runtimeOnly(project(":network-client-default"))
27-
} else {
25+
if (findProperty("httpURLConnection") == null) {
2826
runtimeOnly(project(":network-client-okhttp"))
27+
} else {
28+
runtimeOnly(project(":network-client-default"))
2929
}
3030
testImplementation(libs.bundles.tests)
3131
}

0 commit comments

Comments
 (0)