Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@mother/socket.io-adapter-mongo
Advanced tools
npm install @mother/socket.io-adapter-mongo --save
const io = require('socket.io')(3000);
const mongoAdapter = require('@mother/socket.io-adapter-mongo');
io.adapter(mongoAdapter('mongodb://localhost/test'));
or pass an object:
const io = require('socket.io')(3000);
const mongoAdapter = require('@mother/socket.io-adapter-mongo');
io.adapter(mongoAdapter({
uri: 'mongodb://localhost/test',
key: 'socket.io',
mOptions: {
tls: true
}
}));
By running socket.io with the socket.io-adapter-mongo
adapter you can run
multiple socket.io instances in different processes or servers that can
all broadcast and emit events to and from each other.
If you need to emit events to socket.io instances from a non-socket.io process, you should use socket.io-emitter.
uri
is a a mongodb:// uri string
If using this method of calling the adapter, the uri string will used instead of the uri property in the options object.
For a list of options see below.
The following options are allowed:
uri
: mongodb:// uri string this property or the mongoose
property are required.key
: the name of the key to pub/sub events on as prefix (socket.io
)collectionName
: the name of the capped collection to be used (socket.io-message-queue
)collectionSize
: the size of the capped collection to be used, in bytes (1000000
) (10mb)mongoose
: an existing Mongoose instance that can be used instead of a mongodb:// urimOptions
: options to pass to MongooseThe following options are passed to Mongoose by default:
useNewUrlParser
: trueuseUnifiedTopology
: trueIf you want to override these options, just include them in mOptions
.
MIT
FAQs
socket.io adapter for MongoDB
The npm package @mother/socket.io-adapter-mongo receives a total of 9 weekly downloads. As such, @mother/socket.io-adapter-mongo popularity was classified as not popular.
We found that @mother/socket.io-adapter-mongo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.