I\'m writing a simple api endpoint to determine if my server is able to reach the internet. It works great, but after 5 requests (exactly 5, every time) the request hangs. S
If you wait long enough, the 5 requests will time-out and the next 5 will process so the application isn't really hanging, because it will eventually process through all of the requests.
To speed up the process you need to do something with the response data such as r.on('data', function() {});