Issue while reading end-of-day file from NSE (Java client)

susovanpal
susovanpal edited December 2019 in General
Note: This topic is not related to Kite API.
I'm able to execute below sample code locally (output: 200 OK) but unable to execute (output: timeout) the same code in AWS ec2 server. This code used to work perfectly fine in AWS ec2 until last week, but stoped working since last few days.

Due to this issue, I'm unable to read end-of-day data from NSE by running Java client in AWS ec2 server.
public class CheckURL {
public static void main(String[] args) {
HttpClient httpClient = HttpClients.custom().setUserAgent("Java Agent").build();
String urlString = "https://www.nseindia.com/content/historical/EQUITIES/2019/DEC/cm26DEC2019bhav.csv.zip";

try {
HttpGet request = new HttpGet(urlString);
HttpResponse response = httpClient.execute(request);

System.out.println("Status code: " + response.getStatusLine().getStatusCode());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
Note: ec2 server connected to Internet Gateway and Inbound/Outbound both are set to All traffic.

Any help would be greatly appreciated.
Sign In or Register to comment.