webhook
webhook copied to clipboard
Add ability to stream command output as a response (fixes conflict #443)
Just fix conflict pr #443, thanks @milolav
would it be possible to get this merged? we've got a long running command, and only see the output after everything finished. streaming the output would be really great.
Much needed. Please merge.
Any news about this PR? The feature would be quite useful.
Any news about this PR?
I'll try to test this out next week, and hopefully get it merged if I don't run into any issues :)
Hmm, in order to get the streaming to work, I had to set these headers in the response as well:
w.Header().Set("Content-Type", "text/event-stream")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
Without those headers I observed command output not being streamed, but rather buffered & spit out after the connection is closed.
Do you think this header override is acceptable?
Another question, should we also stream the output to the logs in parallel, maybe even introduce a separate setting "include-command-output-in-the-logs" (or something less verbose)? :)