|
1 month ago | |
---|---|---|
openrc | 1 month ago | |
src | 1 month ago | |
.gitignore | 1 month ago | |
Cargo.lock | 1 month ago | |
Cargo.toml | 1 month ago | |
LICENSE | 6 months ago | |
README.md | 1 month ago |
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.
There's a demo instance running at tcp.famfo.xyz:51337
.
Building
Run cargo build --release
to build the project and use the generated binary in target/release/qbin
.
Running
qbin
expects the following environment variables at runtime:
QBIN_LISTEN
- the network address to listen on (e.g.127.0.0.1:1234
)QBIN_DB
- SQLite3 database file pathQBIN_LOG
- log level (trace
,debug
,info
,warn
orerror
), default:warn
Simple OpenRC service scripts are available in the openrc
directory.
Usage
qbin
requires the input stream to be closed before proceeding with the input (e.g. EOF).
The recommened tool is OpenBSD's netcat, available on most *nixes:
pfetch | nc -N tcp.famfo.xyz 51337
Or alternatively, nmap's ncat
available on most platforms (including Windows):
pfetch | ncat tcp.famfo.xyz 51337
A sucessful run will return the paste ID. Pastes also can be retreived with netcat/ncat:
echo '!get <paste id>' | nc -N tcp.famfo.xyz 51337
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).