Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
aedes-logging
Advanced tools
Logging module for Aedes, based on Pino.
npm i aedes-logging --save
'use strict'
var fs = require('fs')
var path = require('path')
var http = require('http')
var https = require('https')
var websocket = require('websocket-stream')
var net = require('net')
var tls = require('tls')
var aedes = require('aedes')
var logging = require('aedes-logging')
var instance = aedes()
var servers = [
startHttp(),
startHttps(),
startNet(),
startTLS()
]
logging({
instance: instance,
servers: servers
})
function startHttp () {
var server = http.createServer()
websocket.createServer({
server: server
}, instance.handle)
server.listen(8880)
return server
}
function startHttps () {
var server = https.createServer({
key: fs.readFileSync(path.join(__dirname, 'certs', 'key.pem')),
cert: fs.readFileSync(path.join(__dirname, 'certs', 'cert.pem'))
})
websocket.createServer({
server: server
}, instance.handle)
server.listen(8881)
return server
}
function startNet () {
return net.createServer(instance.handle).listen(8882)
}
function startTLS () {
return tls.createServer({
key: fs.readFileSync(path.join(__dirname, 'certs', 'key.pem')),
cert: fs.readFileSync(path.join(__dirname, 'certs', 'cert.pem'))
}, instance.handle).listen(8883)
}
This will logs something like:
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"listening","time":1462777611365,"address":"::","family":"IPv6","port":8880,"protocol":"http","v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"listening","time":1462777611367,"address":"::","family":"IPv6","port":8881,"protocol":"https","v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"listening","time":1462777611367,"address":"::","family":"IPv6","port":8882,"protocol":"tcp","v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"listening","time":1462777611367,"address":"::","family":"IPv6","port":8883,"protocol":"tls","v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"connected","time":1462777614262,"client":{"id":"mqttjs_bab0eb44"},"v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"published","time":1462777614272,"message":{"topic":"hello","qos":0,"retain":false},"client":{"id":"mqttjs_bab0eb44"},"v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"disconnected","time":1462777614274,"client":{"id":"mqttjs_bab0eb44"},"v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"connected","time":1462777618180,"client":{"id":"mqttjs_c1f2ccce"},"v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"subscribed","time":1462777618196,"subscriptions":[{"topic":"#","qos":0}],"client":{"id":"mqttjs_c1f2ccce"},"v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"unsubscribed","time":1462777619111,"topics":["#"],"client":{"id":"mqttjs_c1f2ccce"},"v":1}
{"pid":55663,"hostname":"MBP-di-Matteo","level":30,"msg":"disconnected","time":1462777619111,"client":{"id":"mqttjs_c1f2ccce"},"v":1}
opts can contain:
servers
: an array of servers to print listening dataserver
: alias for passing an array with a single element to
servers
.instance
: the instance of aedesmessages
: logs all the mqtt PUBLISH received, defaults true
pinoOptions
: options specific to PinoMIT
FAQs
Logging module for Aedes, based on Pino
The npm package aedes-logging receives a total of 9 weekly downloads. As such, aedes-logging popularity was classified as not popular.
We found that aedes-logging 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.