Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 13 days 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T08:31:53.000Z (over 1 year ago)
- Last Synced: 2025-01-12T13:17:30.995Z (21 days ago)
- Topics: http2, static-site-server, zig
- Language: Zig
- Homepage: https://richiejp.com/barely-http2-zig
- Size: 27.3 KB
- Stars: 12
- 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-zigThis 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
```