|
||
---|---|---|
openrc | ||
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md | ||
qbin.toml | ||
rustfmt.toml | ||
sample_qbin.toml |
README.md
qbin
Simple pastebin-like service in asynchronous Rust. Written to demonstrate the superiority of async programming by handling many TCP clients on a single OS thread.
Building
Run cargo build --release
to build the project. The resulting binary will be in the target/release
directory.
Running
qbin
uses a configuration file in the TOML format. A sample config is provided in the repository.
You can specify the config file location using the QBIN_CONFIG
environment variable, otherwise
qbin
looks for a file named qbin.toml
in the working directory.
Simple OpenRC service scripts are available in the openrc
directory.
Usage
qbin
requires the input stream to be closed before proceeding with the input (EOF).
The recommened tool is OpenBSD's netcat, available on most *nixes:
pfetch | nc -N <host> <port>
Or alternatively, nmap's ncat
available on most platforms (including Windows):
pfetch | ncat <host> <port>
A sucessful run will return the paste ID. Pastes also can be retreived with netcat/ncat:
echo 'G!<paste id>' | nc -N <host> <port>
Note: The -N
flag seems to be nonexistent in GNU netcat, although it is essential for qbin
connections to work,
since (unlike termbin.com), qbin doesn't implement a timeout (to improve stability on very slow connections).