Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robdelacruz/lkwebserver
Little Kitten Webserver
https://github.com/robdelacruz/lkwebserver
Last synced: 9 days ago
JSON representation
Little Kitten Webserver
- Host: GitHub
- URL: https://github.com/robdelacruz/lkwebserver
- Owner: robdelacruz
- License: mit
- Created: 2023-02-12T16:45:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-12T10:32:00.000Z (6 months ago)
- Last Synced: 2024-08-02T15:14:58.852Z (3 months ago)
- Language: C
- Homepage:
- Size: 610 KB
- Stars: 278
- Watchers: 4
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Little Kitten Web Server
A little web server written in C for Linux.
- No external library dependencies
- Single threaded using I/O multiplexing (select)
- Supports CGI interface
- Supports reverse proxy
- lklib and lknet code available to create your own http server or client
- Free to use and modify (MIT License)## Usage
To compile:
$ make lkws
Usage:
lkws [homedir] [port] [host] [-f configfile] [--cgidir=cgifolder]
configfile = configuration file containing site settings
see sample configuration file below
homedir = absolute or relative path to a home directory
defaults to current working directory if not specified
port = port number to bind to server
defaults to 8000
host = IP address to bind to server
defaults to localhost
cgifolder = parent directory of cgi scripts
defaults to cgi-bin if not specifiedExamples:
lkws ./testsite/ 8080
lkws /var/www/testsite/ 8080 127.0.0.1
lkws /var/www/testsite/ --cgidir=cgi-bin
lkws -f sites.confSample configuration file:
serverhost=127.0.0.1
port=5000# Matches all other hostnames
hostname *
homedir=/var/www/testsite
alias latest=latest.html# Matches http://localhost
hostname localhost
homedir=/var/www/testsite# http://littlekitten.xyz
hostname littlekitten.xyz
homedir=/var/www/testsite
cgidir=cgi-bin
alias latest=latest.html
alias about=about.html
alias guestbook=cgi-bin/guestbook.pl
alias blog=cgi-bin/blog.pl# http://newsboard.littlekitten.xyz
hostname newsboard.littlekitten.xyz
proxyhost=localhost:8001# Format description:
#
# The host and port number is defined first, followed by one or more
# host config sections.
#
# The host config section always starts with the 'hostname '
# line followed by the settings for that hostname. The section ends
# on either EOF or when a new 'hostname ' line is read,
# indicating the start of the next host config section.Compiles and runs only on Linux (sorry, no Windows version... yet)
## Todo
- add logging
- add perf tests for many simultaneous clients