
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-redux-websocket
Advanced tools
redux-middleware send actions through a websocket and dispatch received messages
A websocket Middleware
This middleware send and receive actions from a server, dispatching as needed
const FOO = 'FOO';
function Bar() {
return {
type: FOO,
payload: "Receive this"
socket: {
send: true
}
};
}
npm install react-redux-websocket
Then you create the socket and use ApplyMiddleware
import {createStore, applyMiddleware} from 'redux';
import reduxWebsocket from 'react-redux-websocket';
const socket = new WebSocket('ws://localhost:3030');
const store = createStore(rootReducer, applyMiddleware(reduxWebsocket(socket)));
Any action received through the websocket will be dispatched and handled normally, so your reducers should handle them.
To send actions through the socket you need the special object socket with the key send set to true
const FOO = 'FOO';
function Bar() {
return {
type: FOO,
payload: "Receive this"
socket: {
send: true
}
};
}
The socket object has some properties that you can use, currently those properties are: send, keepSocket and silent.
const FOO = 'FOO';
function Bar() {
return {
type: FOO,
socket: {
send: true, // The action will be send through the socket, default: false
keepSocket: false, // If false, the socket object will be removed after send, default: false
silent: false // If true, it will not raise erros if fail to send, default: false
}
};
}
run
npm test
react-redux-websocket is free and unencumbered software released into the public domain. See UNLICENSE for details.
FAQs
redux-middleware send actions through a websocket and dispatch received messages
We found that react-redux-websocket 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.