-
Feature Request
-
Resolution: Done
-
Minor
-
None
-
None
-
None
I am developing porable Java EE 7 application. For that, I am using the standard JAX-RS API. The application supports/deploys on Wildfly and Websphere. On Wildfly, the JAX-RS API is provided by RestEasy.
I would like to access a resource via a proxy-server and configure it in a way that i do not depend on RestEasy specific classes/interfaces as this would break the deployment on Websphere.
Under Websphere, i can easily provide the proxy-settins via properties on the clientBuilder:
ClientBuilder cb = ClientBuilder.newBuilder(); cb.property("com.ibm.ws.jaxrs.client.proxy.host", "hostname"); cb.property("com.ibm.ws.jaxrs.client.proxy.port", "8888";); cb.property("com.ibm.ws.jaxrs.client.proxy.type", "HTTP"); Client c = cb.build();
See here for the documentation.
On ReastEasy/Wildfly, the only option to set the proxy without compile-dependency on RestEasy, was to use refelection to access the defaultProxy-method that only exists on the ResteasyClientBuilder:
ClientBuilder cb = ClientBuilder.newBuilder(); cb = (ClientBuilder) (cb.getClass().getMethod("defaultProxy", String.class, int.class).invoke(cb, "proxy", 81)); Client c = cb.build();
It would be a nice enhancement to be able to set the proxy via properties like on Websphere.
- relates to
-
WFLY-11737 RESTEasy support for setting HTTP proxy by using JAX-RS API
- Closed