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-protocol-decoder
Advanced tools
Protocol decoder for Aedes MQTT Broker
The purpose of this module is to be used inside aedes decodeProtocol
hook, which is called when aedes instance receives a first valid buffer from client ( before CONNECT packet). The client object state is in default and its connected state is false.
The function extract socket details and if aedes trustProxy
option is set to true, it will first parse http headers (x-real-ip | x-forwarded-for) and proxy protocol (v1 and v2) to retrieve information in client.connDetails.
The function protocolDecoder
returns ConnectionDetails, if the object contains data property, it will be parsed as an mqtt-packet.
npm install aedes-protocol-decoder --save
var aedes = require('aedes')
var { protocolDecoder } = require('aedes-protocol-decoder')
var net = require('net')
var port = 1883
var broker = aedes({
decodeProtocol: function (client, buffer) {
var proto = protocolDecoder(client, buffer)
return proto
},
preConnect: function (client, done) {
if (client.connDetails && client.connDetails.ipAddress) {
client.ip = client.connDetails.ipAddress
}
return done(null, true)
},
trustProxy: true
})
var server = net.createServer(broker.handle)
server.listen(port, function () {
console.log('server listening on port', port)
})
MIT
FAQs
Aedes plugin to decode connection frame and validate proxies
The npm package aedes-protocol-decoder receives a total of 1,187 weekly downloads. As such, aedes-protocol-decoder popularity was classified as popular.
We found that aedes-protocol-decoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.