nodejs https callback not updating global variable [duplicate]
问题 This question already has answers here : How do I return the response from an asynchronous call? (36 answers) Closed 5 years ago . I'm setting up a quick proxy server in nodejs to proxy a API request for an Angular application. The proxy endpoint is a service I do not control and does not support CORS or JSONP. For testing, I setup a dummy http server in the code example below, but in reality this is a remote domain. I'm pretty sure my problem is due to asynchronous processing of nodejs, but