This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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!

Parents
  • 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!

    Asaf Shechter
    Micro Focus (now OpenText) Technical Success Manager
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

Reply
  • 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!

    Asaf Shechter
    Micro Focus (now OpenText) Technical Success Manager
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

Children