Question
How to set up proxy for the REST Connector
I know how to configure for HTTP Connector (below are the changes I did) but I am not getting for the REST Connector.Please help me.
For HTTP Connector:
I updated the jave code something like below(for HHTP connector with below code I was able to set the proxy)
In OTB Activity InvokeHTTPConnector-> step 3 Java code(adding below code in line 231)
client = new com.pega.apache.commons.httpclient.HttpClient();
com.pega.apache.commons.httpclient.HostConfiguration config = client.getHostConfiguration();
config.setProxy("phxappgwe2-vip.phx.aexp.com","9090");
But for the REST connector on the same lines need to modify Java code for the Activity "pyInvokeRestConnector". This OTB Activity has 6 java steps.I need to know where in these steps I need to update this setting proxy code.
Can you please suggest and help me
Message was edited by: Sunil Kumar
Message was edited by: Marissa Rogers - Added Category, moved from Mesh Help
Hi Sunil,
Which version of PRPC are you referring to? Support for proxy on pyInvokeRestConnector already exists on latest versions (I've verified 7.1.9)
Step4 - pyInvokeRestConnector activity
String proxyHost = System.getProperty("http.proxyHost");
if (proxyHost != null && proxyHost.length() > 0) {
String proxyPort = System.getProperty("http.proxyPort");
int proxyPortInt = Integer.parseInt(proxyPort);
com.pega.apache.http.HttpHost proxy = new com.pega.apache.http.HttpHost(proxyHost, proxyPortInt); // Instantiate new HttpHost for proxy config
You will have to set JVM args http.proxyHost and http.proxyPort to make the REST call go through the proxy.