listhen
listhen copied to clipboard
feat: http2 support
๐ Linked issue
Closes #10
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [x] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
Here is a node.js native http2 support using the http2
module.
RequestListener's are now self defined since it seems, there is no type/interface including both http
and http2
request and response.
Since the NodeListener
interface from unjs/h3
is for HTTP1.x only, it is defined in dev.ts
. Maybe the NodeListener
type should be moved to h3.
The secureServer
is started with http1 enabled, so it's possible to connect to the server with http1.x and http2. This is shown by the added test.
It isn't possible to connect to a non encrypted HTTP2 server (see HTTP2 FAQ). This is also shown by a test.
Also a server type is created.
๐ Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.