daho 0.1.2
daho: ^0.1.2 copied to clipboard
A fast, minimal HTTP framework for Dart backed by a native H2O server over FFI, with an Express/Fiber-style API and multi-core support.
0.1.2 #
- Add native TLS support:
DahoConfig.tlsCertPath/tlsKeyPath(PEM cert chain + private key) make H2O terminate TLS itself and negotiateh2/http/1.1via ALPN — previously there was no cert/key API anywhere in the stack and the native wrapper never set up anSSL_CTX, so TLS was only possible behind a reverse proxy. An invalid/missing cert or key logs to stderr and falls back to plain HTTP for that worker rather than crashing. OneDahoinstance is still all-HTTP or all-HTTPS (no redirect/dual-port yet — see README's "HTTPS / TLS" section). - Fix: response header names were sent with whatever casing the route
handler used (e.g.
Content-Type) — harmless over HTTP/1.1 (case -insensitive) but a protocol violation over HTTP/2, which requires lowercase header names (RFC 7540 §8.1.2) and made clients reject every response withPROTOCOL_ERROR. This was unreachable before native TLS existed (no ALPN, soh2could never be negotiated) and surfaced immediately once it did.c_src/h2o_wrapper.cnow lowercases header names before handing them to H2O, for both HTTP/1.1 and HTTP/2. - Fix:
serveStatic/H2O's file handler served every static file asapplication/octet-stream, regardless of extension —h2o_file_registerwas passed aNULLmimemap, which H2O initializes as an empty map (no built-in extension table). Harmless for a classic<script src>(no MIME enforcement), but broke ES module scripts andWebAssembly.compileStreaming()outright, since both enforce strict MIME checking.c_src/h2o_wrapper.cnow builds a shared mimemap (.js/.mjs→text/javascript,.wasm→application/wasm, plus.css/.json/.svg/images/fonts/etc.) and passes it to every static directory's file handler. Requires rebuilding the native wrapper (daho build --forceorcmake --build c_src/build).
0.1.1 #
- Fix:
c_src/CMakeLists.txtnow explicitly links OpenSSL and zlib. The native wrapper only linked cleanly before because Homebrew'sh2oformula happens to ship a sharedlibh2o-evloop.dylibthat carries those dependencies transitively — a from-source build (e.g. in Docker, since H2O has no Debian/Ubuntu package) produces a staticlibh2o-evloop.a, which doesn't, and failed to link with undefinedSSL_*/X509_*/deflate/inflatesymbols. - Fix:
example/13_authentication.dartno longer buildsAuthDatabase/JwtService/SessionManager/AuthRoutesinmain()and references them from the top-levelroutesbuilder — worker Isolates don't share state constructed inmain(), so every worker crashed withLateInitializationError. Everything routes need is now built fresh insidesetupRoutes, with only the one-time migration run left inmain(). Also adds a role-gated/api/adminexample route.
0.1.0 #
- Initial release.
- Express/Fiber-style HTTP framework for Dart.
- Native H2O server via FFI with multi-core support (SO_REUSEPORT).
- O(1) static routing + radix trie for parameterized routes.
- Built-in middleware: logger, CORS, secure headers, gzip compression.
- Multipart file upload support.
- Cookie management.
- In-process test harness (DahoTester).
- Graceful shutdown with configurable drain period.
dahoCLI for scaffolding, building, and running projects.