On a much older version of node I'd come up with a solution but that no longer works. For those who don't know
xinetd
listens for incoming requests over a network and launches the appropriate
service for that request. The service communicates with its client by reading from stdin and writing to stdout. I tried:
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
// Listen on stdin
server.listen({fd: 0});
but this fails because the connection has already been established by xinetd. Is there a way to set the server connection to stdin and cause the callback to be executed without listening?
Ted