stock-market-india icon indicating copy to clipboard operation
stock-market-india copied to clipboard

Not working in production serevers like vercel , digital oceans and aws cloud

Open rizwan92 opened this issue 4 years ago • 6 comments

i see you are passing custom headers to request from local but this settings are not working for production servers

var options = {
    headers: {
      'X-Requested-With': 'XMLHttpRequest',
      'Referer': 'https://www.nseindia.com/ChartApp/install/charts/mainpage.jsp',
      Host: 'www.nseindia.com'
    },
    transformResponse: searchTransformer(false)
  };

i applied .catch section for this to know what went wrong but request is not rejecting and catching the error

 NSEAPI.searchStocks(req.query.keyword)
    .then(function (response) {
      console.log("search response",response.data)
      res.json(response.data);
    }).catch((errr)=>{
      console.log(errr)
    });

rizwan92 avatar Dec 11 '20 07:12 rizwan92

Hi @rizwan92 , have you got any work around to deploy this project on production servers like heroku, vercel and aws cloud

anoop0567 avatar Mar 31 '21 16:03 anoop0567

I stuck at some point . We might have take to take different approach. I could complete it all i need is time

rizwan92 avatar Mar 31 '21 16:03 rizwan92

If you have AWS you need to have it configured in India. NSE is not accessible outside india. May be a dedicated Indian Proxy can help which is cheap as compared to have a dedicated instance.

trezapeter89 avatar May 22 '21 10:05 trezapeter89

Hi @rizwan92 , did u get any work around for this?

Rahul1d avatar Oct 05 '21 06:10 Rahul1d

Yeahh all you have to do is run servers inside india.

You cannot access stock market from outside of india

Any request coming out side of Indian IPS blocked

rizwan92 avatar Oct 05 '21 08:10 rizwan92

Thanks @trezapeter89 @rizwan92 was really stuck in this one as I deployed them as netlify functions and kept getting Task timed out after 10.01 seconds.

geekysam7 avatar Feb 08 '22 23:02 geekysam7