@mntm/http
v0.7.0
Published
Speed up any node.js server
Downloads
1
Readme
@mntm/http
Speed up any node.js server. Implements http.createServer around uWebSockets.js.
Benchmark
|name |req/sec | |-----------------|---------| |low-http-server* |54272 | |@mntm/http |49882 | |native |39458 |
low-http-server has a lack of implementation, but we are comparing with it because it too uses uWebsockets.js
Introduction
There are many frameworks that use uWebSockets.js, including:
This package implements native node.js createServer
, which can be integrated with any framework, for example:
import fastify from 'fastify';
import http from '@mntm/http';
const app = fastify({
serverFactory: (handler, opts) => http.createServer(handler)
});
Known limitations
This package doesn't rely on IncomingMessage
and ServerResponse
because request and response APIs are built from scratch. They cannot be replaced with an essentially incompatible foreign prototype. This means that Express has poor compatibility.
Installation
We recommend to use yarn for dependency management:
yarn add @mntm/http
Contributing
Development of @mntm/http happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements.
License
@mntm/http is MIT licensed.