Skip to content

Commit fa5c274

Browse files
Add docu for TP loader
1 parent 4048e70 commit fa5c274

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docs-java/features/connectivity/008-transparent-proxy.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,48 @@ try {
211211

212212
For more information, see [Troubleshooting](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-troubleshooting)
213213

214+
## Transparent Proxy Loader
215+
216+
The `TransparentProxy` class is a `DestinationLoader` that enables routing all destination traffic through a single registered gateway host.
217+
This provides a centralized approach to proxy configuration where all destination requests are automatically routed through the configured gateway.
218+
219+
### Registration Methods
220+
221+
#### Register with Default Port
222+
223+
Register a transparent proxy gateway using the default port 80:
224+
225+
```java
226+
// Register with default port 80
227+
// Note: 'gateway.svc.cluster.local' is a sample for a typical Kubernetes Cluster IP service DNS name pointing to the Transparent Proxy [Destination Gateway](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/dynamic-lookup-of-destinations)
228+
TransparentProxy.register("gateway.svc.cluster.local");
229+
```
230+
231+
The host will be verified if it is reachable and must not contain any path components.
232+
If no scheme is provided, HTTP will be used by default.
233+
234+
#### Register with Custom Port
235+
236+
Register a transparent proxy gateway with a specified port:
237+
238+
```java
239+
// Register with custom port when Destination Gateway is exposed on a different port via .service.port field in the Destination Custom Resource
240+
TransparentProxy.register("http://gateway.svc.cluster.local", <port>);
241+
```
242+
243+
The final URI will be constructed as: `<normalized-host>:<port>`
244+
245+
### Usage Example
246+
247+
```java
248+
// Register the transparent proxy during application initialization
249+
TransparentProxy.register("gateway.svc.cluster.local", 8080);
250+
251+
// All subsequent destination requests will be routed through the registered gateway
252+
// Note: returns TransparentProxyDestination which implements Destination
253+
Destination destination = DestinationAccessor.getDestination("my-destination");
254+
```
255+
214256
## Related Documentation
215257

216258
- [HTTP Client](http-client) - For using destinations with HTTP clients

docs-java/features/connectivity/TransparentProxy

Whitespace-only changes.

0 commit comments

Comments
 (0)