How to set system proxy inside Groovy script on OBM?

Hi!

While working with event forwarding rules I'm having big trouble using groovy scripts and proxy config at a client's server. If you access the desired URL through a web browser or postman it works fine (bc it's using system proxy), when the event forwarding script is executed it keeps giving a UnknownHostException. 

screenshot.png

 

We made tests in postman NOT using the system proxy and it doesn't connect I already tried setting the proxy on the script using http.proxyHost and http.proxyHost properties to no avail.

Is there a way to set the proxy settings inside the script or in OBM settings?

**I must say that this script and rule have been tested on a personal and internal laboratory with good results (without proxy settings)

Thanks beforehand!

  • Verified Answer

    You can provide proxy details in the Groovy script where you open the connection to the ticketing system.
    If you can provide the code snippet where you do that then maybe we can help more.
    Here is simple example from the internet:
    //Proxy instance, proxy ip = 10.0.0.1 with port 8080
    Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.0.0.1", 8080));
    conn = new URL(urlString).openConnection(proxy);

    good luck!
  • Hello  !

    I followed your recommendation and added the lines to my Groovy script, now is working like charm.

    Thank you a lot for your help