
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
Portable pure JavaScript ES6 HTTP library. Includes fast streaming regex-free parser for HTTP/1.0 and HTTP/1.1.
npm install eshttp
Requires ES6/2015 JS engine (Node.js 4.0). Example web server using eshttp:
'use strict';
const eshttp = require('eshttp');
const server = new eshttp.HttpServer();
const response = new eshttp.HttpResponse(200, { 'x-header': 'value' }, 'hello');
server.onrequest = request => {
request.respondWith(response);
};
server.listen(8080);
$ node -v
v4.2.1
$ wrk -t12 -c400 -d30s http://127.0.0.1:8080/
Running 30s test @ http://127.0.0.1:8080/
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 21.12ms 2.32ms 98.16ms 88.23%
Req/Sec 1.25k 489.35 4.03k 83.52%
336337 requests in 30.09s, 38.81MB read
Socket errors: connect 155, read 181, write 0, timeout 0
Requests/sec: 11177.42
Transfer/sec: 1.29MB
$ wrk -t12 -c400 -d30s http://127.0.0.1:8080/
Running 30s test @ http://127.0.0.1:8080/
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.46ms 1.75ms 76.40ms 94.03%
Req/Sec 1.76k 1.36k 5.97k 62.83%
630789 requests in 30.10s, 72.79MB read
Socket errors: connect 155, read 130, write 21, timeout 0
Requests/sec: 20959.47
Transfer/sec: 2.42MB
const eshttp = require('eshttp');
Represents immutable HTTP response.
Construct immutable HTTP response object that can be reused multiple times to serve different clients.
| Argument | Type | Description |
|---|---|---|
| code | number | HTTP code |
| headers | Headers | object | Response headers object |
| body | string | Response body string |
const response = new eshttp.HttpResponse(200, { server: 'eshttp' }, 'OK.');
Represents immutable HTTP request.
Construct immutable HTTP request object that can be reused multiple times.
| Argument | Type | Description |
|---|---|---|
| method | string | HTTP request method (e.g. 'GET') |
| path | string | Request path |
| headers | Headers | object | Request headers object |
| body | string | Request body string (optional) |
const request = new eshttp.HttpRequest('GET', '/', { 'User-Agent': 'eshttp' });
Represents HTTP server.
Construct HTTP server object.
const server = new eshttp.HttpServer();
Start listening to HTTP requests.
server.listen(8080);
Stop listening.
server.close();
Request handler callback.
server.onrequest = request => {
console.log('new incoming request');
};
##LICENSE
MIT
FAQs
ES6-style pure JavaScript HTTP library
We found that eshttp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.