Skip to content
A lightweight multithreaded web server
C Other
  1. C 98.3%
  2. Other 1.7%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cgi-bin
site
.gitignore
.travis.yml
LICENSE
README.md
helper.c
helper.h
makefile
threadpool.c
threadpool.h
tin.c

README.md

Build Status

A lightweight web server written in C

Tin is a multi-threaded web server that supports both static and dynamic contents. It has a one-thread-multiple-active-clients architecture implemented using a thread-pool and handles large number of concurrent requests.

Tin is implemented with some goals in mind:

  • Fast and responsive
  • Ability to handle large number of concurrent requests
  • Support Python frameworks well

Compilation

make

or

gcc tin.c -o tin -pthread

Usage

Put index.html (default homepage), other pages and resources under the same directory. Then run:

./tin [port]

You will see requests coming in.

Dynamic content

Put your CGI binary under cgi-bin directory and access it using

http://[your domain/ip address]:[port]/cgi-bin/[program]?[parameter1]&[parameter2]&[...]

For example, to run the adder cgi program that comes with Tin, go to:

http://[your domain/ip address]:[port]/cgi-bin/adder?1+2

Contribute

Please consider contributing to our project and learn with us along the way!

You can’t perform that action at this time.