Simple pastebin-like service in asynchronous Rust
 
 
Go to file
lemonsh 2e45a08694 Update documentation 2023-01-16 17:55:49 +01:00
openrc Update documentation 2023-01-16 17:55:49 +01:00
src Add config file, remove ratelimit (temporarily), modernize everything. 2023-01-16 17:44:18 +01:00
.gitignore Update documentation 2023-01-16 17:55:49 +01:00
Cargo.lock Add config file, remove ratelimit (temporarily), modernize everything. 2023-01-16 17:44:18 +01:00
Cargo.toml Add config file, remove ratelimit (temporarily), modernize everything. 2023-01-16 17:44:18 +01:00
LICENSE Create LICENSE 2021-11-30 22:55:55 +00:00
README.md Update documentation 2023-01-16 17:55:49 +01:00
qbin.toml Update documentation 2023-01-16 17:55:49 +01:00
rustfmt.toml Add config file, remove ratelimit (temporarily), modernize everything. 2023-01-16 17:44:18 +01:00
sample_qbin.toml Update documentation 2023-01-16 17:55:49 +01:00

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).