
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@nullify/libp2p-rpc
Advanced tools
Bi-directional RPC over libp2p streams.
npm i @nullify/libp2p-rpc
import create from "@nullify/libp2p-rpc";
// We need a libp2p bundle as derived from js-ipfs, js-libp2p, or the below...
import node from "@nullify/libp2p-bundle";
const run = async () => {
// Create two peers for communicating
const node1 = await node({
multiaddrs: ["/ip4/0.0.0.0/tcp/4007", "/ip4/0.0.0.0/tcp/4008/ws"],
});
const node2 = await node();
// Create a "server" peer (all peers can be both client and peer)
await create(node1, { ping: () => "pong" });
// Create a "client" peer and keep reference to dialer function
const dial = create(node2, { pong: () => "ping" });
// Start em up!
await node1.start();
await node2.start();
// Get reference to node1's multiaddress
const addrs = node1.multiaddrs.map(
(ma) => `${ma.toString()}/p2p/${node1.peerId.toB58String()}`
);
// Dial node1 and establish rpc client
const remote = await dial(addrs[0]);
// Ping node1/remote and get result
const result = await remote.ping();
console.log(result);
// Spin em' down
await node1.stop();
await node2.stop();
process.exit();
};
run();
create(host, rpc): (addr: any) => Promise<import('znode')>
/**
* Setup a handler and return a dialer for the specified RPC specification.
* @param {import("libp2p")} host The local host used to dial and make the
* connection.
* @param {any} rpc An object representing a set of RPC methods
* as defined in {@link https://github.com/mikeal/znode}.
*/
const create = (host, rpc) => {
...
}
handler(rpc): ({ stream: { source, sink } }) => Promise<import('znode')>
/**
* Create a handler function to be used by a libp2p host.
* @param {any} rpc An object representing a set of RPC methods
* as defined in {@link https://github.com/mikeal/znode}.
*/
const handler = (rpc) => {
...
}
dialer(host, rpc): (addr: any) => Promise<import('znode')>
/**
* Create a dialer function to setup an RPC connection with a remote libp2p peer.
* @param {import("libp2p")} host The local host used to dial and make the
* connection.
* @param {any} rpc An object representing a set of RPC methods
* as defined in {@link https://github.com/mikeal/znode}.
*/
const dialer = (host, rpc) => {
...
}
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2021 Carson Farmer
FAQs
Bi-directional RPC over libp2p streams
The npm package @nullify/libp2p-rpc receives a total of 1 weekly downloads. As such, @nullify/libp2p-rpc popularity was classified as not popular.
We found that @nullify/libp2p-rpc 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.