Yet another lightweight and easy to use HTTP(S) server

Related tags

Command-line raptor
Overview

Raptor Web server

Raptor is a HTTP server written in Rust with aims to use as little memory as possible and an easy configuration. It is built on top of tokio an asynchronous runtime for rust.

Install

There's not prebuilt binaries yet. So it is required to build the project using the rust tool chain (use rustup to install it if you don't have the tool chain already installed). Then use cargo to build the project for you.

$ cargo build --release

Usage

In order to launch the server you must provide a json config file. You can check if your custom config is valid with the --validate flag.

Configuration

Here is an sample config file

{
    "vhosts": [
        {
            "name": "*:8080",
            "ip": "127.0.0.1",
            "port": 8080,
            "root_dir": "."
        },
        {
            "name": "127.0.0.1:3000",
            "ip": "127.0.0.1",
            "port": 3000,
            "is_ipv6": false,
            "root_dir": ".",
            "cert_key": "public.pem",
            "private_key": "private.pem"
        }
    ]
}

An virtual host must at least have :

  • An ip
  • A port
  • The root directory of the served files

Vhost matching

You can use shell pattern matching as the fnmatch function does. Not that the first matching vhost will be used. They're tested in the same order as they're declared in the config file.

A default vhost can be specified with is_default flag, thus it will be used if a given hostname don't match any existing vhost. If there's no default specified vhost the first one will be used as a default vhost.

{
    "vhosts": [
        {
            "name": "127.0.0.1:3000",
            "ip": "127.0.0.1",
            "port": 3000,
            "root_dir": ".",
            "is_default": true
        }
    ]
}

Ipv6 Support

Raptor supports ipv6, you can specify an ipv6 address in the ip field. Don't forget to enable ipv6 for the vhost using the is_ipv6 flag.

Here is an example to create a vhost listening on port 8080 for localhost.

{
    "vhosts": [
        {
            "name": "[::1]:8080",
            "ip": "::1",
            "port": 8080,
            "root_dir": ".",
            "is_ipv6": true
        }
    ]
}

Tls support

Raptor supports tls connections (HTTPS). A vhost will use a secure connection if both cert_key and private_key are specified otherwise it will fallback to plain HTTP.

Example:

{
    "vhosts": [
        {
            "name": "127.0.0.1:3000",
            "ip": "127.0.0.1",
            "port": 3000,
            "root_dir": ".",
            "cert_key": "public.pem",
            "private_key": "private.pem"
        }
    ]
}

Note

This server is still in development and is therefore not production ready.

TODOLIST

  • Complete file management with HTTP method like PUT and PATCH.
  • Support for compression
  • More flags to control how the server behave
You might also like...
YAL is Yet Another scripting Language(but worse)

YAL - Yet Another Language YAL is yet another scripting language(but worse). Syntax Basic syntax fun main() { print("Hello, World!"); } Fibonacci

Yet another command-line chat GPT frontend written in Rust.
Yet another command-line chat GPT frontend written in Rust.

gpterm Yet another command-line chat GPT frontend written in Rust. Features Stream output with typing effect Store chat messages/history Context aware

Yet another code execution engine written in Rust.
Yet another code execution engine written in Rust.

exec Yet another blazingly fast code execution engine written in Rust. Paths GET /api/v1/status GET /api/v1/runtimes POST /api/v1/execute POST /api/v1

Nerf is (yet another) rust GUI lib

NERF Nerf is (yet another) rust GUI lib. It is heavily inspired by Flutter, and is designed to build apps that could run on any plateforms, such as wi

Yet another Python environment manager.

yen The easiest Python environment manager. Create virtual environments for any Python version, without needing Python pre-installed. Installation Get

A fast and lightweight HTTP server implementation in Rust.

server_nano A tiny, fast, and friendly web server written in rust and inspired by express. It uses may to coroutines Usage First, add this to your Car

82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead.
82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead.

Spinners for Rust 82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead, all the way from simple dots, to fun emoji based "spi

Over-simplified, featherweight, open-source and easy-to-use authentication and authorization server.

concess ⚠️ Early Development: This is not production ready, yet. Do not use it for anything important. Introduction concess is a over-simplified, feat

A blazing fast and easy to use TRPC-like server for Rust.

rspc 🚧 Work in progress 🚧 A blazing fast and easy to use TRPC-like server for Rust. Website Example You define a trpc router and attach resolvers to

Owner
Volham
Volham
Yet Another Texture Packer - a small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet

YATP (Yet Another Texture Packer) A small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet. Installation

Petar Petrov 2 Sep 11, 2022
Yay - Yet another Yogurt - An AUR Helper written in Go

Yay Yet Another Yogurt - An AUR Helper Written in Go Help translate yay: Transifex Features Advanced dependency solving PKGBUILD downloading from ABS

J Guerreiro 8.6k Jan 1, 2023
yet another typing test, but crab flavoured

toipe A trusty terminal typing tester for the tux. Usage Install cargo install toipe Run typing test toipe looks best on a nice terminal (such as Ala

Samyak Sarnayak 431 Dec 20, 2022
Yet another fractal generator (based on glium)

Juliabrot Yet another fractal generator. Juliabrot is a Rust application using the OpenGL Framework to render in realtime. Install Rust To download Ru

Max 2 Feb 27, 2022
Yet another package manager for Rust.

Rpip Installing. Make sure you have just (packages) installed! Once you have just installed move into the root directory (where this file is) and run

null 2 Apr 27, 2022
Yet another Codeforces cli

cf-tool-rs A Rust implement for https://github.com/xalanq/cf-tool WIP. Pull Requests / Contributions are welcomed! How to Configure? Configure File sh

Woshiluo Luo 2 May 8, 2022
Yet another sort crate, porting Golang sort package to Rust.

IndexSort IndexSort Yet another sort crate (in place), porting Golang's standard sort package to Rust. Installation [dependencies] indexsort = "0.1.0"

Al Liu 4 Sep 28, 2022
🚀 Yet another repository management with auto-attaching profiles.

?? ghr Yet another repository management with auto-attaching profiles. ?? Motivation ghq is the most famous solution to resolve stress of our reposito

Naoki Ikeguchi 29 Dec 2, 2022
Yet another phigros chart player.

prpr - P hig R os P layer, written in R ust Usage To begin with, clone the repo: git clone https://github.com/Mivik/prpr.git && cd prpr For compactnes

Mivik 6 Jan 1, 2023
⚡🦀 Yet another rust system info fetcher.

Yarsi: Yet another rust sys info fetcher ✨ Showcase requirements ?? cargo ?? install with $ curl https://sh.rustup.rs -sSf | sh installation ❤️‍?? Ya

BinaryBrainiacs 8 Jan 26, 2023