
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Lightweight local network peer discovery and data transfer library using WebRTC + Bonjour.
LocalBeam is a lightweight, zero-config peer-to-peer communication library built on top of WebRTC, enabling real-time data, file, and message transfer between devices on the same local network — without any external servers.
It combines a local signaling server (using WebSockets + Bonjour/mDNS discovery) with a simple client SDK that works seamlessly in React, Node, or browser environments.
npm install localbeam
# or
yarn add localbeam
If running locally for development:
git clone https://github.com/<your-username>/localbeam.git
cd localbeam
npm install
node server.js
You should see logs like:
[INFO] LocalBeam server running on port 3001
[INFO] Bonjour service published: LocalBeam Signaling Server
Example (React):
import React, { useEffect, useState } from "react";
import { PeerManager, SignalingClient } from "localbeam";
export default function App() {
const [clientId] = useState("client-" + Math.floor(Math.random() * 1000));
const [manager, setManager] = useState(null);
const [peers, setPeers] = useState([]);
const [messages, setMessages] = useState([]);
const [input, setInput] = useState("");
useEffect(() => {
const signaling = new SignalingClient(clientId, { baseUrl: "http://localhost:3001" });
const peerManager = new PeerManager(signaling, clientId);
setManager(peerManager);
signaling.connect();
peerManager.on("peer-list", (list) => setPeers(list.filter(p => p !== clientId)));
peerManager.on("peer-connected", (pid) => setMessages(m => [...m, `✅ Connected to ${pid}`]));
peerManager.on("data", (_from, data) => setMessages(m => [...m, `📩 ${data}`]));
return () => peerManager.closeAll();
}, [clientId]);
const send = () => {
if (!manager) return;
peers.forEach(p => manager.send(p, input));
setMessages(m => [...m, `📤 ${input}`]);
setInput("");
};
return (
<div>
<h3>LocalBeam Demo</h3>
<p>Client ID: {clientId}</p>
<p>Peers: {peers.join(", ") || "none"}</p>
<input value={input} onChange={e => setInput(e.target.value)} />
<button onClick={send}>Send</button>
<pre>{messages.join("\n")}</pre>
</div>
);
}
✅ Open the app in two browsers or devices on the same LAN — they'll auto-discover and connect.
const sendFile = async (e) => {
const file = e.target.files?.[0];
if (!file || !manager) return;
const arrayBuffer = await file.arrayBuffer();
const payload = {
type: "file",
name: file.name,
mime: file.type,
size: file.size,
data: Array.from(new Uint8Array(arrayBuffer)),
};
peers.forEach(p => manager.send(p, payload));
};
Receiving peers will automatically reconstruct and download the file.
LocalBeam
├── server/ # Signaling + discovery (WebSocket + Bonjour)
│ └── server.js
├── src/core/
│ ├── signalingClient.ts # WebSocket signaling logic
│ ├── peerManager.ts # WebRTC peer lifecycle management
│ └── strategies/
│ ├── directTransfer.ts # Simple direct send
│ ├── chunkedTransfer.ts # (optional) large files
│ └── ...
└── examples/react-demo/ # Example React app
| Project | Type | Status | Repo |
|---|---|---|---|
localbeam-react | React example app demonstrating peer discovery & file transfer | ✅ Done | localbeam-react |
| Option | Default | Description |
|---|---|---|
| baseUrl | http://localhost:3001 | Signaling server URL |
| bonjourService | LocalBeam Signaling Server | Bonjour (mDNS) name |
| port | 3001 | WebSocket server port |
| Method | Description |
|---|---|
| connect() | Connect to signaling server |
| on(event, handler) | Listen to "open", "close", "peer-list" |
| Method | Description |
|---|---|
| createConnection(peerId) | Initiate WebRTC connection |
| send(peerId, data) | Send text, buffer, or file |
| closeAll() | Close all active connections |
| on(event, handler) | Listen to "peer-connected", "data", "peer-list" |
[INFO] WebSocket connected to ws://192.168.1.21:3001
[INFO] Peer registered: react-client-217
[INFO] ✅ Connected to peer react-client-634
[INFO] 📦 Received file: sample.pdf (128KB)
Here's what's coming next in LocalBeam:
Follow the GitHub repository for updates!
Contributions are welcome! To start hacking:
git clone https://github.com/<your-username>/localbeam.git
cd localbeam
npm install
npm run dev
Submit PRs or open issues for bugs, features, or documentation.
MIT License © 2025 Oneiros8 Use freely, modify, and share.
FAQs
Lightweight local network peer discovery and data transfer library using WebRTC + Bonjour.
We found that localbeam 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.