1.0.1 • Published 3 years ago

esniffer v1.0.1

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

ESniffer 🔬

Modern network analyze tool. Alternatives to Hoxy, Charles, etc.

Install

npm i esniffer
yarn add esniffer

Example

// index.js
import ESniffer from "esniffer";
import fs from "fs";

// Required if you want to monitor over HTTPS
const key = fs.readFileSync(`path/to/root-key.pem`);
const cert = fs.readFileSync(`path/to/root-cert.pem`);

const proxy = ESniffer.createServer({ secure: { key, cert } });
proxy.listen(8080);

proxy.on("request", (req) => {
  req.pipe(process.stdout);
});
proxy.on("response", (res) => {
  res.pipe(process.stdout);
});
proxy.on("info", (info) => {
  console.log(info);
});
proxy.on("error", (e) => {
  console.error(e.message);
});

Start and configure the proxy server

node index.js

In your mac, from System Preferences > Network > Advanced... > Proxies tab, configure the proxy as follows:

ProtocolHostPort
Web Proxy (HTTP)127.0.0.18080
Secure Web Proxy (HTTPS)127.0.0.18080

Finally, don't forget OK and Apply.

Events

namedescriptiontype
infoLogs of the proxy serverstring
errorErrors occurring on the proxy serverError
requestRequest object to the actual serverhttp.IncomingMessage
responseResponse object to the actual serverhttp.IncomingMessage
1.0.1

3 years ago

1.0.0

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago