socket-spy

1.0.0 • Public • Published

socket-spy

Handly logger for plaintext socket traffic.

Use Cases

Originally developed to inspect HTTP multipart/form-data request bodies with nested file paths in @http/api for the http2.live service.

Also useful for:

  • Inspecting a single, low-traffic connection in development.
  • Viewing the raw network data to debug problems.
  • Understanding low-level protocol details.
  • Satisfying a healthy sense of technical curiosity.

Definitely not useful for:

  • Production
  • Performance
  • Security

Usage

Print all incoming HTTP requests in the terminal as raw data.

const server = require('http').createServer()
server.on('connection', require('socket-spy'))
server.listen(0, () => {
  console.log(`Listening on port ${server.address().port}`)
})

Readme

Keywords

none

Package Sidebar

Install

npm i socket-spy

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • seb