https://github.com/richiejp/barely-http2
Barely working HTTP/2 Zig library
https://github.com/richiejp/barely-http2
http2 static-site-server zig
Last synced: about 1 year ago
JSON representation
Barely working HTTP/2 Zig library
- Host: GitHub
- URL: https://github.com/richiejp/barely-http2
- Owner: richiejp
- Created: 2023-04-30T13:38:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T08:31:53.000Z (about 3 years ago)
- Last Synced: 2025-04-12T05:45:52.650Z (about 1 year ago)
- Topics: http2, static-site-server, zig
- Language: Zig
- Homepage: https://richiejp.com/barely-http2-zig
- Size: 27.3 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Barely HTTP/2 in Zig
Something like the minimum Zig implementation of HTTP/2 to serve a
request from Curl. I still need to use TLS and ALPN to get browsers
working.
There are quite some comments in the source code and a blog article:
https://richiejp.com/barely-http2-zig
This is for a follow on article to:
https://richiejp.com/zig-vs-c-mini-http-server
## Serve files
Run the following
```sh
$ zig run src/self-serve2.zig -- /static/site
info: Listening on 127.0.0.1:9000; press Ctrl-C to exit...
```
Then in a different terminal
```sh
$ curl -s -v --http2-prior-knowledge http://localhost:9000
```
## Just print frame info
A second entry point in the main lib just prints the HTTP/2 frames it
receives.
```sh
$ zig run src/http2.zig
```