bidirectiond
bidirectiond (abbreviated to bdd) is a reverse proxy framework (written in c) for linux. it uses sysconf(_SC_NPROCESSORS_ONLN)
worker threads, each with its own
it currently implements these features:
- multiple threads
- server name indicition (sni)
- application-layer protocol negotiation (alpn)
- graceful shutdowns
- connection timeouts
it currently offers these apis to services:
this function should be called by services at the end of every instantiate call they receive, to add an instance of itself to bidirectiond's core for a name and protocol (where wildcards are supported for both) associates a pointer with a conversation. services can use this to store state for a conversation. retrieves the pointer associated with the conversation instructs the core to free the conversation as soon as possible. bidirectiond does not offer to services an api to free a conversation immediately. this causes ungraceful shutdowns so it should only be used upon encountering an unrecoverable error. this is the only way to create a connection from a service; it returns a fresh io in the "obtained" state tries to enable ssl for the "obtained" io, discarding the io if it fails tries to connect the io from the "obtained" or "prepared ssl" states, discarding the io if it fails to reads bytes from the io reads pending bytes from the io. before your service's event handler returns, it must always call this function until it returns <= 0 for any io that it called bdd_io_read on. tries to write bytes to the io flushes bytes written to the underlying socket by temporarily setting tcp_nodelay on it sends tls close_notify + tcp fin, discarding the io if it has been completely shut down
it will never implement these features:
- support for tls versions older than v1.3
download bidirectiond
unavailable
verify bidirectiond
- from inside the git repo
- git will return 0 on success (i.e., if the signature is good)
curl https://aiden.cmp.bz/pubkey.txt | gpg --import && git verify-commit HEAD
compile bidirectiond
gcc -O2 -c -o output/gs.o services/gs/gs.c python3 services/glue.py python3 build.py -fuse-ld=ld -DNDEBUG
output/bidirectiond