Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1952

Allow to set proxy via JAX-RS API

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Minor Minor
    • 3.8.0.Final, 4.1.0.Final
    • 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.

            rhn-support-asoldano Alessio Soldano
            daniel.platz_jira Daniel Platz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: