$ go get github.com/mesuutt/ssed
You can pipe STDOUT of any command-line program to ssed for send output of the program to the SSE clients:
$ ./printEverySecond.sh | ssed
Reading from STDIN
Listening on localhost:3000
You can use ssed with named pipes too:
cat <> myfifo | ssed &
echo 'text' > myfifo
Also you can send messages to SSE clients with a prompt with starting ssed
with -p
argument:
$ ssed -p
Listening on localhost:3000
(1 clients)-> hello
Sent message: hello
(1 clients)-> how are you?
Sent message: how are you?
$ ssed -h
Usage of ssed:
-v Verbose debug messages
-l string
Listening address and port (default "localhost:3000")
-p Show prompt for message which send to clients