https://github.com/musgravejw/http_server
Micro HTTP Server
https://github.com/musgravejw/http_server
c http http-server
Last synced: about 1 year ago
JSON representation
Micro HTTP Server
- Host: GitHub
- URL: https://github.com/musgravejw/http_server
- Owner: musgravejw
- License: bsd-3-clause
- Created: 2019-10-28T18:33:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-22T02:29:10.000Z (over 5 years ago)
- Last Synced: 2025-01-30T05:26:04.731Z (about 1 year ago)
- Topics: c, http, http-server
- Language: C
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP Server

Opens a TCP connection on `127.0.0.1:80`.
Serves files in the `www` directory.
```shell
.
├── LICENSE
├── Makefile
├── README.md
├── dist
│ └── server
├── src
│ ├── parser.c
│ └── server.c
└── www
└── index.html
3 directories, 7 files
```
## Install
```shell
$ make
```
## Usage
```shell
$ ./dist/server
Starting server...
Listening on port 80...
```
## GET
## Request
```
GET index.html HTTP/1.1
Host: 127.0.0.1
Accept: image/gif, image/jpeg
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
```
## Response
```
HTTP/1.1 200 OK
Last-Modified: Sat, 20 Nov 2019 07:16:26 GMT
ETag: "10000000565a5-2c-3e94b66c2e680"
Accept-Ranges: bytes
Content-Length: 44
Connection: close
Content-Type: text/html
[html document]
```
## License
* This project is licensed under a BSD 3-Clause License
Copyright (c) 2019, John Musgrave All rights reserved.
## Author
Written by John Musgrave.