2

I need to call third party web service via proxy.

I only have information below:
- Third party https IP & Port
- Proxy http IP & Port

May I know I need credential : username & Password for the Proxy?

Part of my code below:-

CloseableHttpClient httpclient = HttpClients.createDefault();

    HttpHost proxy = new HttpHost(proxyHost, proxyPort);
    DefaultProxyRoutePlanner routePlanner = new
    DefaultProxyRoutePlanner(proxy);
    CloseableHttpClient httpclient = HttpClients.custom()
    .setRoutePlanner(routePlanner)
    .build();

        RequestConfig config =RequestConfig.custom().setProxy(proxy).build();

            HttpPost httppost = new HttpPost(queryUrl);
            httppost.setConfig(config);

CloseableHttpResponse httpResponse = httpclient.execute(httppost);

Unfortunately, Proxy server reponse me "Access denied. Authentication is required."

Any idea for this problem?

user1238353
  • 179
  • 2
  • 15

0 Answers0