You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,13 +37,14 @@ The following platforms are supported:
37
37
38
38
---
39
39
40
-
## Using Ably SDK Under a Proxy
40
+
## Proxy support
41
41
42
-
When working in environments where outbound internet access is restricted, such as behind a corporate proxy, the Ably SDK allows you to configure a proxy server for HTTP and WebSocket connections.
42
+
You can add proxy support to the Ably Java SDK by configuring `ProxyOptions` in your client setup, enabling connectivity through corporate firewalls and secured networks.
43
43
44
-
### Add the Required Dependency
44
+
<details>
45
+
<summary>Proxy support setup details.</summary>
45
46
46
-
You need to use **OkHttp** library for making HTTP calls and WebSocket connections in the Ably SDK to get proxy support both for your Rest and Realtime clients.
47
+
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.
47
48
48
49
Add the following dependency to your `build.gradle` file:
49
50
@@ -53,13 +54,9 @@ dependencies {
53
54
}
54
55
```
55
56
56
-
### Configure Proxy Settings
57
+
After adding the OkHttp dependency, enable proxy support by specifying proxy settings in the ClientOptions when initializing your Ably client.
57
58
58
-
After adding the required OkHttp dependency, you need to configure the proxy settings for your Ably client. This can be done by setting the proxy options in the `ClientOptions` object when you instantiate the Ably SDK.
59
-
60
-
Here’s an example of how to configure and use a proxy:
61
-
62
-
#### Java Example
59
+
The following example sets up a proxy using the Pub/Sub Java SDK:
63
60
64
61
```java
65
62
importio.ably.lib.realtime.AblyRealtime;
@@ -98,6 +95,8 @@ public class AblyWithProxy {
98
95
}
99
96
```
100
97
98
+
</details>
99
+
101
100
## Resources
102
101
103
102
Visit https://www.ably.com/docs for a complete API reference and more examples.
0 commit comments