Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
[![npm version](https://badge.fury.io/js/yamux-js.svg)](https://www.npmjs.com/package/yamux-js) [![Build status](https://img.shields.io/github/actions/workflow/status/th-ch/yamux-js/node.js.yml?branch=master)](https://github.com/th-ch/yamux-js) [![GitHub
Yamux-js (Yet another Multiplexer) is a Node.js (TypeScript/JavaScript) port of the multiplexing library for Golang made by HashiCorp: https://github.com/hashicorp/yamux. The 2 libraries are fully interoperable (you can have a client in Golang and a server in JS, or the other way around).
From https://github.com/hashicorp/yamux:
It relies on an underlying connection to provide reliability and ordering, such as TCP or Unix domain sockets, and provides stream-oriented multiplexing. It is inspired by SPDY but is not interoperable with it.
Yamux features include:
Install Yamux-js using yarn
:
yarn add yamux-js
Or npm
:
npm install --save yamux-js
var {Client} = require('yamux-js');
var client = new Client();
client.on('error', (err) => {
console.log('An error occured:', err);
});
client.pipe(commonXXXChannel).pipe(client);
var stream1 = client.open();
stream1.on('end', () => {
console.log('client disconnected');
});
stream1.on('data', (data) => {
console.log('recv:', data.toString());
});
stream1.on('error', (err) => {
console.log('An error occured:', err);
});
stream1.write('Sending data');
var stream2 = client.open();
// ...
var {Server} = require('yamux-js');
var server = new Server((stream) => {
stream.on('end', () => {
console.log('client disconnected');
});
stream.on('data', (data) => {
console.log('recv:', data.toString());
stream.write('Sending back data');
});
stream.on('error', (err) => {
console.log('An error occured:', err);
});
});
server.on('error', (err) => {
console.log('An error occured:', err);
});
server.pipe(commonXXXChannel).pipe(server);
Both Server
and Client
can take a custom config as last argument in their constructor:
{
// AcceptBacklog is used to limit how many streams may be
// waiting an accept.
// WARNING [Difference with the Go implementation]: total number of streams, not in-flight
acceptBacklog: number; // default: 256
// EnableKeepalive is used to do a period keep alive
// messages using a ping.
enableKeepAlive: boolean; // default: true
// KeepAliveInterval is how often to perform the keep alive
keepAliveInterval: number; // In seconds, default: 30
// ConnectionWriteTimeout is meant to be a "safety valve" timeout after
// we which will suspect a problem with the underlying connection and
// close it. This is only applied to writes, where's there's generally
// an expectation that things will move along quickly.
connectionWriteTimeout: number; // In seconds, default: 10
// MaxStreamWindowSize is used to control the maximum
// window size that we allow for a stream.
maxStreamWindowSize: number; // default: 256 * 1024 (256 KB)
// Logger is used to pass in the logger to be used.
logger: typeof console.log; // default: console.log
}
0.1.2
FAQs
[![npm version](https://badge.fury.io/js/yamux-js.svg)](https://www.npmjs.com/package/yamux-js) [![Build status](https://img.shields.io/github/actions/workflow/status/th-ch/yamux-js/node.js.yml?branch=master)](https://github.com/th-ch/yamux-js) [![GitHub
The npm package yamux-js receives a total of 1,097,937 weekly downloads. As such, yamux-js popularity was classified as popular.
We found that yamux-js 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.