I would like to have NodeJS API to be able to communicate with program (not wirtten by myself) which listens on localhost Unix socket 5050. I can 'echo' from shell to Unix socket 5050 where this program listens
$echo '{"output": "connecting"}' > /dev/tcp/localhost/5050
Now, for external programs to write to this localhost socket I need API, don't know how to do it:
app.post('/output', function (req, res) {
//echo '{"output": "connecting"}' > /dev/tcp/localhost/5050
});