
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@automattic/happychat-connection
Advanced tools
The SocketIO API models the SocketIO event flow purely as Redux actions. By making the SocketIO API Redux-driven, we have several advantages:
The connection has the following methods:
init( ... )
: configure the connection.send( action )
: receives a send Redux action and emits the corresponding SocketIO event.request( action, timeout )
: receives a request Redux action and emits the corresponding SocketIO event. Unlike send, the event fired takes a callback to be called upon ACK, or a timeout callback to be called if the event didn't respond after timeout milliseconds.Every inbound SocketIO event dispatches its own Redux action, which is namespaced with the HAPPYCHAT_IO_RECEIVE_EVENTNAME
type. Its action creator name convention is receiveEventname
.
For example:
init
SocketIO event dispatches the receiveInit
action whose type is HAPPYCHAT_IO_RECEIVE_INIT
.message
SocketIO event dispatches the receiveMessage
action whose type is HAPPYCHAT_IO_RECEIVE_MESSAGE
.See client/state/happychat/connection/actions.js
for a complete list of actions.
Every outbound SocketIO event has a corresponding Redux action. The middleware binds the Redux action with the proper connection method. The Redux actions types are namespaced with the HAPPYCHAT_IO_SEND_EVENTNAME
or HAPPYCHAT_IO_REQUEST_EVENTNAME
and the corresponding action creators are named after the connection method they use and its event name.
See client/state/happychat/connection/actions.js
for a complete list of actions.
The init
action uses the connection.init
method. Its action creator is called initConnection
and the action shape is:
{
type: HAPPYCHAT_IO_INIT,
auth // promise that holds the Authentication mechanism
}
Any send
action uses the connection.send
method. Its action creator name convention is sendEventname
and the action shape:
{
type: HAPPYCHAT_IO_SEND_EVENTNAME,
event: 'eventname'
payload: ... // contents to be sent, can be anything: object, string, etc
}
Note that, at the moment of writing, we are using the message
event to send different kind of messages: user messages, regular events, log events, and user info. These actions were shortened to convey a better API to upper layers without leaking underlying details, so the actions are named sendMessage
, sendEvent
, sendLog
sendUserInfo
instead of sendMessageMessage
, sendMessageEvent
, etc.
Any request
action uses the connection.request
method. Its creator name convention is requestEventname
and the action shape:
{
type: HAPPYCHAT_IO_REQUEST_EVENTNAME,
event: 'eventname',
payload: ... // contents to be sent, can be anything: object, string, etc
timeout: timeout,
callback: receiveTranscript,
}
FAQs
Happychat connection manager
The npm package @automattic/happychat-connection receives a total of 55 weekly downloads. As such, @automattic/happychat-connection popularity was classified as not popular.
We found that @automattic/happychat-connection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 37 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.