How do I Periodically sending data to an APP

I have data that I want to send to an APP periodically after an initial request to the agent. Currently the data I want to send correctly prints in the log, but the agent gives:
ERROR: Attempt to send same httpresponse twice. Not sending.

What am I missing?

Currently, when you do resp.send it closes the request (in other words you can’t do outbound streaming requests).

You’ll need to have your app make periodic requests to the agent, rather than the agent send periodic responses for one request.

Alternatively, you can look at a service like PubNub or Firebase that will handle synching data for you!