Skip to content

a tiny web server in C, for daily use.

Notifications You must be signed in to change notification settings

7890/tiny-web-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A tiny web server in C

I am reading Computer Systems: A Programmer's Perspective. It teachers me how to write a tiny web server in C.

I have written another tiny web server in JAVA.

And another one http-kit, http-kit is full featured, with websocket and async support

And few others on my github page.

Features

  1. Basic MIME mapping
  2. Very basic directory listing
  3. Low resource usage
  4. sendfile(2)
  5. Support Accept-Ranges: bytes (for in browser MP4 playing)
  6. Concurrency by pre-fork

Non-features

  1. No security check

Usage

tiny <port>, opens a server in the current directory, port default to 9999, just like python -m SimpleHTTPServer

I use it as a lightweight File Browser.

TODO

  1. Write a epoll version

License

The code is free to use under the terms of the MIT license.

About

a tiny web server in C, for daily use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 97.9%
  • Makefile 1.1%
  • Shell 1.0%