jlxip / zodiac

A reverse proxy and load balancer for Gemini

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zodiac

Introduction

Zodiac is a low-footprint high-performance reverse proxy and load balancer for Gemini, written in C++. Think of it like an nginx for Gemini, meant to connect to FastCGI-like local servers, or backends.

This project:

  • Soothes the Gemini backend creation, since they don't need to worry about:
    • TLS
    • Timeouts
    • CRLF, meaning that it's guaranteed to be there
  • Performs demultiplexing of requests via SNI.
  • Returns status code 43 (PROXY ERROR) in case the backend doesn't answer.
  • Can handle many simultaneous connections with very little resources.

Configuration file

The configuration file defaults to ./zodiac.conf, but a different one can be specified via the ZODIAC_CONFIG environment variable.

An example config is given in the example.conf file at the root of the repository.

FastCGI-like protocol

The backend receives <URL><CR><LF><Client's IP><CR><LF>. This way, the proxy is transparent while the specification is not broken, since the second line can be ignored.

Docker

A Dockerfile is available at the root of this repository. It is automatically built and pushed to the Docker Hub on each release, with the name jlxip/zodiac. To use it, run something along the lines of:

docker volume create zodiac_config
sudo cp yourconfig.conf /var/lib/docker/volumes/zodiac_config/_data/zodiac.conf
docker run -d -p 1965:1965 --name myserver --restart=unless-stopped -v zodiac_config:/config jlxip/zodiac:latest

Additional information

Backends for zodiac

  • bsgemini, by me, for static servers, written in C++.

Things to do before 1.0.0

  • Timeouts
  • Multiple capsules
  • Worker threads
  • More config (listening IP, port, timeouts)
  • RR load balancing
  • Config file in other place ($ZODIAC_CONFIG)
  • Move to epoll
  • CI/CD
  • Docker image

About

A reverse proxy and load balancer for Gemini

License:GNU General Public License v3.0


Languages

Language:C++ 58.4%Language:Makefile 39.9%Language:Dockerfile 1.7%