
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@web4/bitswarm-proxy
Advanced tools
Proxy p2p connections using a duplex stream and Bitswarm
const BitswarmProxyServer = require('@web4/bitswarm-proxy/server')
const server = new BitswarmProxyServer({
// The bootstrap nodes to pass to bitswarm (optional)
bootstrap,
// Whether your server will be sort lived (ephemeral: true)
ephemeral,
// Pass in an existing bitswarm instance instead of creating a new one (optional)
network,
// Function that takes incoming connections to decide what to do with them
// Can be used to notify clients about peers
// Disconnect incoming by default
handleIncoming: (socket) => socket.end(),
})
const somestream = getStreamForClient()
// Get the server to handle streams from clients
server.handleStream(somestream)
// Tell all clients about a peer for a particular topic
// This is useful in conjunction with `handleIncoming`
// Use handleIncoming to figure out which topic the connection is from
// Then tell clients to connect to them using `socket.address()`
server.connectClientsTo(SOME_TOPIC, port, hostname)
// Close connections to clients and any connected peers
server.destroy(() => {
// Done!
})
const BitswarmProxyClient = require('@web4/bitswarm-proxy/client')
const somestream = getStreamForServer()
const swarm = new BitswarmProxyClient({
// Pass in the stream which connects to the server
// If this isn't passed in, invoke `.reconnect(somestream)` to start connecting
connection: somestream,
// Whether you should autoconnect to peers
autoconnect: true,
// The max number of peers to connect to before stopping to autoconnect
maxPeers: 24,
})
// When we disconnect, reconnect to the server
swarm.on('disconnected', () => {
swarm.reconnect(getStreamForServer())
})
// Same as bitswarm
swarm.on('connection', (connection, info) => {
const stream = getSomeStream(info.topic)
// Pipe the data from the connection into something to process it
// E.G. `bitdrive.replicate()`
connection.pipe(stream).pipe(connection)
})
swarm.join(topic)
swarm.leave(topic)
// Listen for peers manually
swarm.on('peer', (peer) => {
// If autoconnect is `false` you can connect manually here
swarm.connect(peer, (err, connection) => {
// Wow
})
})
// Destroy the swarm
swarm.destroy()
FAQs
Proxy p2p connections using a duplex stream and Bitswarm
We found that @web4/bitswarm-proxy 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.