STDHTTP is a Go application that provides an HTTP interface for standard streams. It allows redirecting stdout and stderr of running processes to specified HTTP endpoints and also manages the processes themselves using a built-in broker.
- Redirect
stdoutandstderrto specified URLs via HTTP. - Manage processes started with
stdhttp runthrough commands likestdhttp listandstdhttp kill. - Start a debug server to monitor and manage processes in debug mode.
You can download pre-built binaries for your operating system from the GitHub releases page.
- Go to the Releases page.
- Download the appropriate archive for your OS:
- For Linux:
stdhttp-linux-amd64.tar.gz - For Windows:
stdhttp-windows-amd64.tar.gz
- For Linux:
- Extract the archive:
- For Linux:
tar -xvf stdhttp-linux-amd64.tar.gz
- For Windows, extract the ZIP using your preferred tool (e.g., WinRAR, 7-Zip or built-in Windows Explorer functionality).
- For Linux:
- After extracting, you should have the following binaries:
- Linux:
stdhttp - Windows:
stdhttp.exeandstdhttpd.exe
- Linux:
- (Optional) Move the binary to a directory in your
$PATH:- For Linux:
sudo mv stdhttp /usr/local/bin/
- For Windows, add the binary path to your system environment variables.
- For Linux:
The STDHTTP application has three main commands: run, broker, and debug.
You can redirect the standard streams stdout and stderr of a command to specified HTTP URLs using the --stdout-url and --stderr-url options:
stdhttp run --stdout-url URL --stderr-url URL COMMAND [ARG ...]Example:
stdhttp run --stdout-url http://localhost:8080/stdout --stderr-url http://localhost:8080/stderr ls -laIf you start the broker with the stdhttp broker command, you can monitor and manage the processes you run:
Start the broker:
stdhttp brokerList active processes (wait for a 10 seconds after starting the broker):
stdhttp listRun a command:
stdhttp run COMMAND [ARG ...]Kill a process by its PID or kill processes by a pattern:
stdhttp kill {PID|PATTERN}If broker goes down, you can restart it with the stdhttp broker command. Also if you want to see the broker in the list of processes, you can run it with stdhttp run command:
stdhttp run stdhttp brokerOr you can run the broker in the background:
stdhttpd run stdhttp brokerYou can also start a debug server to track requests in debug mode. To do this, use the command:
stdhttp debugOnce the debug server is running, you can run commands with the --debug flag to send requests to the debug server:
stdhttp run --debug COMMAND [ARG ...]You can run stdhttp in the background on both Linux and Windows.
To run stdhttp in the background on Linux, you can use the & symbol after the command.
Example:
stdhttp run --stdout-url http://localhost:8080/stdout --stderr-url http://localhost:8080/stderr COMMAND [ARG ...] &You can also use standard tools like nohup or screen for more advanced background management if needed.
On Windows, to run stdhttp in background mode, you should use the stdhttpd.exe binary instead of stdhttp.exe. This daemon version (stdhttpd.exe) will run the process in the background without holding up the terminal.
Example:
stdhttpd.exe run --stdout-url http://localhost:8080/stdout --stderr-url http://localhost:8080/stderr COMMAND [ARG ...]This allows you to start processes and redirect their output without occupying the terminal window.
STDHTTP uses options and environment variables for configuration. For more details, run stdhttp --help.
STDHTTP is distributed under the BSD 3-Clause License. For more details, see the LICENSE.md file.