Speed up any node.js server. Implements http.createServer around uWebSockets.js.
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
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)
});
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.
We recommend to use yarn for dependency management:
yarn add @mntm/http
Development of @mntm/http happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements.
@mntm/http is MIT licensed.