
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@poki/netlib
Advanced tools
The Poki Networking Library is a peer-to-peer networking library for web games, leveraging WebRTC datachannels to enable direct UDP connections between
The Poki Networking Library is a peer-to-peer networking library for web games, leveraging WebRTC datachannels to enable direct UDP connections between players. Think of it as the Steam Networking Library for the web, designed to make WebRTC as simple to use as WebSockets for game development.
[!WARNING] This library is still under development and considered a beta. While it's being actively used in production by some games, the API can change. Make sure to get in touch if you want to go live with this so we can keep you up-to-date about changes.
True Peer-to-Peer (P2P) Networking
UDP Performance
Easy to Use
Production Ready
yarn add @poki/netlib
# or
npm install @poki/netlib
import { Network } from '@poki/netlib'
const network = new Network('<your-game-id>')
// Create a new lobby
network.on('ready', () => {
network.create()
})
// Or join an existing one
network.on('ready', () => {
network.join('ed84')
})
// Send messages
network.broadcast('unreliable', { x: 100, y: 200 })
// Receive messages
network.on('message', (peer, channel, data) => {
console.log(`Received from ${peer.id}:`, data)
})
For more detailed examples and API documentation:
Your Game
↓
Netlib API
↓
WebRTC DataChannels
↓
(STUN/TURN if needed)
↓
UDP Transport
While Poki provides hosted STUN/TURN and signaling services for free, you can also self-host these components:
Set up your own signaling server
Using the provided Docker image:
$ docker build -t netlib .
$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 -e ENV=local netlib
Or by running the signaling server binary directly:
$ go build -o signaling cmd/signaling/main.go
$ ENV=local ./signaling
For persistent storage remove ENV=local and set DATABASE_URL to your PostgreSQL database URL.
Configure your own STUN/TURN servers.
Initialize the network with custom endpoints:
const network = new Network('<game-id>', {
signalingServer: 'wss://your-server.com',
stunServer: 'stun:your-stun.com:3478',
turnServer: 'turn:your-turn.com:3478'
})
We welcome contributions! Please see our Contributing Guide for details. This project adheres to the Poki Vulnerability Disclosure Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
The Poki Networking Library is a peer-to-peer networking library for web games, leveraging WebRTC datachannels to enable direct UDP connections between
The npm package @poki/netlib receives a total of 5 weekly downloads. As such, @poki/netlib popularity was classified as not popular.
We found that @poki/netlib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers 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 discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.