#250·webhook

Streaming command output

Author: wrouesnelCreated May 16, 2018Updated Dec 22, 2025
Labelsenhancement

I'd like to propose extending webhook to support streaming command output. The idea would be to add an extra option like stream_stdout_as_response which would mean the executed command would be streamed back rather then buffered up before being returned.

The protocol would be that a 200 OK response would be returned so long as the command wrote at least 1 byte of stdout before exiting. If the command exits non-zero without writing anything, then a regular error message would be returned.

My use-case here is using webhook to add large data export functionality to some of my docker containers - i.e. POST here to run pg_basebackup in the background and write the tar file back to the requester.

Update: I've finished the draft of implementing this here: https://github.com/wrouesnel/webhook/tree/streaming_responses I'll submit a PR once I get the tests fixed and validated.