🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

esniffer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esniffer

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

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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

Keywords

charles

FAQs

Package last updated on 06 Nov 2020

Did you know?

Socket

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.

Install

Related posts