https://github.com/drkwitht/toyserver
A toy HTTP 1.1 server from scratch in Java. Work in progress.
https://github.com/drkwitht/toyserver
http-server http1-1 java threading toy-project
Last synced: 10 months ago
JSON representation
A toy HTTP 1.1 server from scratch in Java. Work in progress.
- Host: GitHub
- URL: https://github.com/drkwitht/toyserver
- Owner: DrkWithT
- Created: 2022-12-31T03:16:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-13T05:50:04.000Z (over 3 years ago)
- Last Synced: 2025-06-09T15:45:52.638Z (12 months ago)
- Topics: http-server, http1-1, java, threading, toy-project
- Language: Java
- Homepage:
- Size: 63.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
Awesome Lists containing this project
README
# Toy (HTTP) Server
## By: Derek Tan / DrkWithT (GitHub)
### Summary:
This Java repo contains files and code for a toy _HTTP 1.1_ server. The server is unintended for production usage and nor has full compliance with HTTP/1.1 for now. Although this will be at best a mediocre implementation, I will continue this project for learning about the HTTP protocol and network programming.
### References:
- Ensure compliance with other HTTP/1.1 requirements based on this link: [HTTP Made Really Easy](https://www.jmarshall.com/easy/http/#http1.1s1)
- RFC 9110: _HTTP Semantics_
### Project Roadmap:
1. Create basic worker and HTTP request-response classes. (DONE)
- Create and integrate a request handler class!
2. Support persistent / non-persistent connections. (DONE FOR NOW)
3. Rewrite server resource code. (DONE)
4. Add HEAD method support. (DONE)
5. Support `If-Unmodified-Since` header. Honor this whenever recieved with a `200` or `304` based on the header's vs. resource's updating date.
6. Support `100 Continue` responses.
7. Support chunked requests.
### Other Todos:
1. The `SimpleRequest` class needs an overhaul to support chunked requests. It might be better to encapsulate the `responseStream` within another `ChunkedRequest` class for an easy fix, as single vs chunked responses have some different grammar.