Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
peero-server
Advanced tools
Websocket server which facilitates discovery between Peero client peers.
WebRTC peers are unable to connect to each other without exchanging connection data (IP adresses, etc). The way this exchange is performed is not a part of the WebRTC spec, so it's up to the developer to come up with a way to do this. There are already signaling servers which do exactly this, but Peero server is just a different type of implementation that's supposed to be simple and open source.
The only thing the server does is keep a list of online peers, and passes SDP data from one peer to another to make those peers connect. All communication between peers is strictly peer-to-peer. There is also an implementation of a Peero client, which connects to the server and available peers.
To run the server, you will need to have Node installed. And then in your CLI:
$ npm install peero-server
Install PM2 globally if it isn't installed already:
$ npm install pm2 -g
Then run the server:
$ cd peero-server
$ pm2 pm2.config.js
A client can connect with the server on ws://localhost:8080
. You can read the PM2 documentation on how to work with the process manager.
You can copy .env.example
to a new .env
file to set some environment settings, for example:
NODE_ENV=production
WS_PORT=8000
The server works only with websocket requests. All messages passed from and to the server are serialized JSON/Javascript objects. For a client to connect to the server it needs to send a 'register' message:
{
type: 'register'
}
When the server receives that message, it will generate a UUIDv4 ID and send it to the client:
{
type: 'register',
data: { peerId: 'af988091-4454...' }
}
The server will simultaneously send messages to other connected clients to announce a new client:
{
type: 'announce',
data: { peerId: 'af988091-4454...' }
}
It will also send all currently connected clients to the new client:
{
type: 'peers',
data: {
peers: [
'6f01ab34-3a56...',
'72a4ad27-bde5...'
]
}
}
FAQs
Websocket server which facilitates discovery between Peero client peers.
The npm package peero-server receives a total of 11 weekly downloads. As such, peero-server popularity was classified as not popular.
We found that peero-server 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.