https://github.com/picocode1/tcp-server
C++ HTTP Server
https://github.com/picocode1/tcp-server
html http http-server server sockets tcp tcp-server
Last synced: 7 months ago
JSON representation
C++ HTTP Server
- Host: GitHub
- URL: https://github.com/picocode1/tcp-server
- Owner: picocode1
- Created: 2022-04-27T20:42:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-08T11:46:19.000Z (almost 3 years ago)
- Last Synced: 2025-06-08T21:41:48.470Z (10 months ago)
- Topics: html, http, http-server, server, sockets, tcp, tcp-server
- Language: C++
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple C++ HTTP Server
### Feature list
- [x] Multiple paths
- [x] 404 page
- [x] No extra HTTP libraries
- [x] Multiple clients
- [x] GET, POST, HEAD, DELETE, OPTIONS, PATCH, PUT
- [x] Live memory view
- [x] Request logging
- [x] MD5 Hash generator
- [ ] C++ Templating engine for HTML
- [ ] HTTPs support
- [ ] Rate limit system
### How to compile
```
gcc server.cpp md5.cpp -o server.exe -lws2_32 -lstdc++ -Os
```
### Example route
```cpp
// Example route for /example with GET
if (app.get("/example", path, method)) {
html += "
C++ Server /example page
";
html += "Hello, world!
";
content_type = "text/html\r\n";
}
```
### Example logs
```console
[SERVER] 127.0.0.1 GET /memory HTTP/1.1
[SERVER] 127.0.0.1 GET / HTTP/1.1
[SERVER] 127.0.0.1 POST /md5 HTTP/1.
```
## C++ - JS Express

## Contributing
Found a bug or problem? File an issue or submit a pull request with the fix.