
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
extended-eventsource
Advanced tools
Spec compliant EventSource implementation for browsers and Node.JS
This is a custom EventSource implementation that is fully compliant with the WHATWG Server-Sent Events specification but takes more arguments like request headers.
It can be used in both web and Node.js environments.
The motivation for this library is that the native browser EventSource does not offer options for changing the request that is sent to the server. This means that e.g. you can not send an authorization header. This is fixed by this library.
Install the package using npm:
npm i extended-eventsource
The package exposes a single class called EventSource
.
To use it, create a new instance of EventSource
with the URL of the server-sent events endpoint, and an optional
configuration object.
import { EventSource } from 'extended-eventsource';
const eventSource = new EventSource('/events', {
headers: {
Authorization: 'Bearer token',
},
retry: 3000,
});
eventSource.onopen = () => {
console.log('Connection opened');
};
eventSource.onmessage = (event: MessageEvent) => {
console.log('Message received:', event.data);
};
eventSource.onerror = (error) => {
console.error('Error occurred:', error);
};
Contributions are welcome! Please feel free to open issues or submit pull requests.
This project is licensed under the MIT License.
FAQs
Spec compliant EventSource implementation for browsers and Node.JS
The npm package extended-eventsource receives a total of 55,454 weekly downloads. As such, extended-eventsource popularity was classified as popular.
We found that extended-eventsource demonstrated a healthy version release cadence and project activity because the last version was released less than 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.