Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
feathers-sync
Advanced tools
Synchronize service events between application instances using Redis or MongoDB publish/subscribe
When running multiple instances of your Feathers application (e.g. on several Heroku Dynos), service events (created
, updated
, patched
, removed
) do not get propagated to other instances. feathers-sync uses MongoDB publish/subscribe via mubsub or Redis via redis to propagate all events to all application instances.
This allows to scale real-time websocket connections to any number of clients.
The application initialized in the following example will use the local feathers-sync
database and sync
collection and share service events with every other instance connected to the same database:
var feathers = require('feathers');
var sync = require('feathers-sync');
var app = feathers();
app.configure(feathers.rest())
.configure(feathers.socketio())
.configure(sync({
db: 'mongodb://localhost:27017/sync',
collection: 'events'
}))
.use('/todos', todoService);
app.listen(3000);
mongodb://localhost:27017/events
) or database objectevents
){authSource:'admin'}
)Additionally you can pass the original sync options:
true
)redis://localhost:6379
) or database objectamqp://guest:guest@localhost:5672
)When listening to service events with this, all events are going to get propagated to all clients. This means, that your event listeners should not perform any actions that change the global state (e.g. write something into the database) because every client will perform the same action.
Instead, event listeners should only be used to update the local state (e.g. a local cache) and send real-time updates to all connected clients, e.g. all browsers listening to websocket events.
If you need to perform actions, for example setting up a first blog post after a new user has been created add it to the service method itself (which will only run on its own instance) or use feather-hooks after hooks.
0.1.0
Copyright (c) 2015 David Luecke
Licensed under the MIT license.
v0.1.4 (2017-11-11)
Closed issues:
patch
or put
requests #63Merged pull requests:
FAQs
Feathers
The npm package feathers-sync receives a total of 1,829 weekly downloads. As such, feathers-sync popularity was classified as popular.
We found that feathers-sync 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.