I want to be listening all the time for incoming messages and since the CLI API requires sudo I thought why not create a system service that starts at boot to listen and forward any the received messages over a local socket for user space processing. I’m running the latest jessie on a RPi.
Running as a user I do this:
nc -l localhost 3001
Running as root I do this:
hologram receive | nc localhost 3001
Then I use web hook and the POST method to send some data
curl -s -d "@mydata.txt" -X POST <my web host URL>
but no messages come through to the user space. When I break it apart to just
hologram receive
and then the above curl
line I can verify that receiving works just fine.
And I can get data across my local socket using:
echo test | nc localhost 3001
So why wouldn’t this work?
hologram receive | nc localhost 3001
Or is there an easier way to listen for data without needing sudo?