I've created this listener to receive commands over websocket on a json formated string.
It can set and get values and issue commands.
Check Command Web Page for examples of set and get commands.
You'll need libwebsockets and pthreads library
To work with json I used: https://github.com/DaveGamble/cJSON
To work with websockets I used this code: https://gist.github.com/martinsik/3654228