GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - RamseyK/httpserver: A high performance, single threaded, HTTP/1.1 server written in C++23 using BSD kqueue for socket event notification

BranchesTags
Open more actions menu

Latest commit

 

History

141 Commits
141 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
compile_flags.txt
compile_flags.txt
 
 

Repository files navigation

HTTP Server

A high-performance, single-threaded, event-driven HTTP/1.1 server written in C++23, built on kqueue. Intended as a learning tool for kqueue-based socket management and the HTTP/1.1 protocol on BSD systems.

Features

  • Efficient event-driven I/O via kqueue
  • Optional privilege dropping (drop_uid / drop_gid) after binding
  • Self-contained HTTP/1.1 parser built on the ByteBuffer library
  • Clean, documented code
  • Tested on FreeBSD and macOS

Requirements

  • A BSD-based system (FreeBSD, macOS) — Linux may work via libkqueue
  • A C++23-capable clang compiler
  • make on macOS; gmake on FreeBSD

Quick start

git clone https://github.com/RamseyK/httpserver.git
cd httpserver
make                       # produces ./bin/httpserver
mkdir htdocs               # document root
$EDITOR server.config      # see Configuration below
./bin/httpserver

Configuration

server.config is read from the working directory. Lines starting with # are ignored. Format: key=value, one per line.

Key Required Description
vhost yes Comma-separated list of host aliases to serve
port yes TCP port (1–65535)
diskpath yes Path to document root (must exist)
drop_uid no UID to drop to after binding (must be set with drop_gid)
drop_gid no GID to drop to after binding (must be set with drop_uid)

Example

$ cat server.config
vhost=10.0.10.86,acme.local
port=8080
diskpath=./htdocs

$ ./bin/httpserver
Primary port: 8080, disk path: ./htdocs
vhost: 10.0.10.86
vhost: acme.local
Server ready. Listening on port 8080...

License

Apache License v2.0. See LICENSE file.


Ramsey Kant — https://github.com/RamseyK/httpserver

About

A high performance, single threaded, HTTP/1.1 server written in C++23 using BSD kqueue for socket event notification

Topics

c-plus-pluscpp23darwinfreebsdhttphttp-serverhttpdkqueueserversocket-programmingsockets

Resources

Readme
Apache-2.0 license
Activity

Stars

83 stars

Watchers

7 watching

Forks

32 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.