It sounds like you just want to make sure your project is running constantly. The way to do that is to trigger a request to a public page on your project, which many community members do with something like UptimeRobot.
That request doesn’t have to be a normal webpage request. You could connect anything to it you wanted to; a websocket or an AJAX request to a POST endpoint would work equally well, although you’ll still need something there to respond to that.
Does that help?