How can I monitor incoming request in Node.js,
Here , actually I am getting continues heart-bits from MODEM , I want to monitor the different request... For some time if I didnt get any request from particular IP i want to some other function ,
How can I check for NO REQUEST FOR some time to NODE.js ??
I tried with
req.on('close', function (){}) // but didn't work for me ...:(
In your request handler, store the IP of the request with the time that the request was received.
Write a function that looks at your store of IPs and determines if there are any IPs from which a request hasn't been received recently enough and does whatever you want to do in response.
Pass that function to setInterval