Skip to content

Commit a02e42e

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

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,52 @@ 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. This provides a centralized approach to proxy configuration where all destination requests are automatically routed through the configured gateway.
217+
218+
### Key Features
219+
220+
- **Single gateway registration** - only one proxy can be registered at a time
221+
- **Host validation** - ensures hosts don't contain paths and are reachable
222+
- **Automatic scheme normalization** - defaults to HTTP if no scheme provided
223+
- **Network connectivity validation** before registration
224+
- **Thread safety considerations** - uses static state and should be registered during application initialization
225+
226+
### Registration Methods
227+
228+
#### Register with Default Port
229+
230+
Register a transparent proxy gateway using the default port 80:
231+
232+
```java
233+
// Register with default port 80
234+
TransparentProxy.register("gateway.svc.cluster.local");
235+
```
236+
237+
The host will be validated for reachability and must not contain any path components. If no scheme is provided, HTTP will be used by default.
238+
239+
#### Register with Custom Port
240+
241+
Register a transparent proxy gateway with a specified port:
242+
243+
```java
244+
// Register with custom port
245+
TransparentProxy.register("http://gateway.svc.cluster.local", 8080);
246+
```
247+
248+
The final URI will be constructed as: `<normalized-host>:<port>`
249+
250+
### Usage Example
251+
252+
```java
253+
// Register the transparent proxy during application initialization
254+
TransparentProxy.register("gateway.svc.cluster.local", 8080);
255+
256+
// All subsequent destination requests will be routed through the registered gateway
257+
Destination destination = DestinationAccessor.getDestination("my-destination");
258+
```
259+
214260
## Related Documentation
215261

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

docs-java/features/connectivity/TransparentProxy

Whitespace-only changes.

0 commit comments

Comments
 (0)