Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rizwan92 opened this issue Dec 11, 2020 · 6 comments

Comments

@rizwan92
Copy link

rizwan92 commented Dec 11, 2020

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)
    });
@anoop0567
Copy link

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

@rizwan92
Copy link
Author

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

@trezapeter89
Copy link

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.

@Rahul1d
Copy link

Rahul1d commented Oct 5, 2021

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

@rizwan92
Copy link
Author

rizwan92 commented Oct 5, 2021

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

@geekysam7
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants