Registry / messaging / p2p-live-share-ws-server

p2p-live-share-ws-server

JSON →
library0.1.1jsnpmunverified

A lightweight WebSocket server enabling peer-to-peer live collaboration sessions, designed for real-time editing and sharing. Version 0.1.1 is the current stable release. It is primarily distributed via npm and can be executed directly with bunx, npx, or yarn dlx. Unlike full signaling servers with STUN/TURN, this package provides a minimal WebSocket signaling endpoint for P2P connections. The project appears stable but has low release cadence.

npm install p2p-live-share-ws-server
INSTALL
IMPORT
SIG · P2P-LIVE-SHARE-WS-
P
p2p-live-share-ws-server
messagingjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

startServer
import { startServer } from 'p2p-live-share-ws-server'
const startServer = require('p2p-live-share-ws-server')
The package is ESM-only; CommonJS require will fail.
WebSocketServer
import { WebSocketServer } from 'ws'
This package uses the 'ws' library internally but does not re-export WebSocketServer. Use the 'ws' package directly for server customization.
run
import { run } from 'p2p-live-share-ws-server'
import run from 'p2p-live-share-ws-server'
Default export is not available; 'run' is a named export.

Imports and runs the WebSocket server on a specified port and hostname.

import { startServer } from 'p2p-live-share-ws-server'; const port = parseInt(process.env.PORT ?? '3000'); const hostname = process.env.HOSTNAME ?? 'localhost'; startServer(port, hostname).then(() => { console.log(`Server running at ws://${hostname}:${port}`); });
Debug
Known issues
gotchaPackage version 0.1.1 is early-stage; breaking changes may occur without major version bump
fix
Pin to exact version or check changelog before upgrading.
affects: >=0.1.0 <1.0.0
breakingESM-only package: CommonJS require() throws error
fix
Use import syntax or dynamic import().
affects: >=0.1.0
gotchaNo built-in TLS/SSL; WebSocket connections are unencrypted by default
fix
Wrap with HTTPS server for production if using WSS.
affects: >=0.1.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module not supported
Using require() with ESM-only package
fix
Switch to import statement or use dynamic import()
TypeError: startServer is not a function
Incorrect import: default import instead of named import
fix
Use import { startServer } from ...
Error: listen EADDRINUSE :::3000
Port already in use
fix
Specify a different port via --port option or environment variable
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
p2p-live-share-ws-server — npm install p2p-live-share-ws-server · libregistry