URL shortener, pastebin & file-sharing service, written from the ground up in C. https://r8r.be
 
 
 
 
 
Go to file
Jef Roosens 11421dca74
doc(ltm): add readme
2024-03-09 20:53:26 +01:00
.woodpecker feat(ci): build for arm64 2023-12-30 17:01:23 +01:00
bench chore: add benchmarking 2023-05-31 20:39:06 +02:00
include refactor(lander): fully integrate new lnm framework router 2024-03-03 09:46:20 +01:00
landerctl feat(landerctl): add option to use custom config file 2023-12-09 10:37:10 +01:00
lnm@195eb9eb48 chore: update changelog and lnm commit 2024-03-09 20:30:50 +01:00
lsm chore: please cppcheck 2023-11-18 22:28:50 +01:00
ltm doc(ltm): add readme 2024-03-09 20:53:26 +01:00
src chore: updated readme and makefile 2024-03-09 13:29:10 +01:00
test refactor: decouple trie into static library 2023-07-28 18:48:44 +02:00
.dockerignore chore: properly compile picohttpparser in lnm; remove old http header 2023-12-07 11:02:20 +01:00
.editorconfig feat: added randomly generated URLs 2022-11-21 12:03:16 +01:00
.gitignore feat(lander): integrate persistent insert & get lsm store 2023-11-08 11:19:33 +01:00
.gitmodules refactor(lander): partial migration to updated lnm framework 2024-03-02 23:31:34 +01:00
ARCHITECTURE.md docs: start architure file 2023-05-29 18:28:45 +02:00
CHANGELOG.md chore: update version to 0.2.1 2024-03-09 20:45:34 +01:00
Dockerfile chore(lander): fix Docker build 2023-11-14 15:34:07 +01:00
Makefile chore: updated readme and makefile 2024-03-09 13:29:10 +01:00
README.md chore(lander): update readme 2023-11-19 13:25:09 +01:00
config.mk chore: update version to 0.2.1 2024-03-09 20:45:34 +01:00
docker-compose.yml fix: accept more headers and bigger requests for browsers 2023-07-21 12:20:27 +02:00

README.md

Lander

Lander is an HTTP/1.1 server that acts as a URL shortener, pastebin and file-sharing service. It's written from the ground up in C, complete with an HTTP framework built on top of an event loop implementation based on Build Your Own Redis with C/C++. Lookup of entries is done using an in-memory trie data structure, and on-disk storage uses a custom binary database format.

The codebase uses one thirdparty library, namely picohttpparser for parsing HTTP requests.

The idea

A URL shortener has always been on my list of things I'd like to write myself. It's simple, yet useful.

for our Algorithms & Datastructures 3 class, we had to implement three different tries (Patricia trie, ternary trie, and a custom one). Considering these are efficient string-based search trees, this gave me the idea to use it as the backend for a URL shortener!

The name

I gave up giving my projects original names a long time ago, so now I just use the names of my friends ;p

Benchmarking

I benchmark this tool using the wrk2 utility. I've provided two Lua scripts to aid with this. To bench publishing redirects, use the following:

wrk2 -s bench/post.lua -t 10 -R 10k -d30s -c32 http://localhost:18080

And to bench GET requests:

wrk2 -s bench/get.lua -t 10 -R 25k -d30s -c32 http://localhost:18080

Of course you're free to change the parameters, but the provided Lua files generate URLs that can be used in the benchmark.