https://github.com/emmmatech/tiny-http-server
a little http server written completely in c, with the stdlib and bsd sockets!
https://github.com/emmmatech/tiny-http-server
Last synced: about 1 year ago
JSON representation
a little http server written completely in c, with the stdlib and bsd sockets!
- Host: GitHub
- URL: https://github.com/emmmatech/tiny-http-server
- Owner: EmmmaTech
- License: mit
- Created: 2025-06-19T03:01:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-07T18:39:14.000Z (about 1 year ago)
- Last Synced: 2025-07-07T22:36:28.775Z (about 1 year ago)
- Language: C
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tiny http server
a little http server written completely in c, with the stdlib and bsd sockets!
my old draft can be found [here](https://gist.github.com/EmmmaTech/c0b6abb7a520e3bb917c1e41df6b6226), if so desired.
## features
- supports most requests made with `HTTP/1.1` (except for `CONNECT`)
- supports concurrent connections via multithreading
- handles http error responses
- supports custom handlers to process requests
- tls support via openssl (off by default)
## usage
```
./build/httpsrv srvdir [port] [inaddr]
```
any file located in the srvdir will automatically be served by the file. any `/` path will automatically relocate to `index.html`.
handlers for http routes can be written using the `HANDLER_FUNC` & `HANDLER` macros. there is an example located in the `src/main.c` file.