3.0.6 • Published 12 months ago
@lmkdbd/signaling v3.0.6
@lmkdbd/signaling
A WebRTC signaling server implementation that supports both DRTC and WebSocket protocols.
Features
- Dual protocol support:
- DRTC (Direct Real-Time Communication) protocol
- WebSocket protocol
- DID (Decentralized Identifier) key support
- Client-server architecture
- Cross-platform compatibility (Browser and React Native support)
Installation
npm install @lmkdbd/signalingUsage
Server Side
You can create either a DRTC server or a WebSocket server:
import { createDrtcServer, createWebSocketServer } from '@lmkdbd/signaling';
// Create a DRTC server
createDrtcServer({
port: 8080,
key: 'your-ssl-key', // SSL key for secure connections
cert: 'your-ssl-cert' // SSL certificate
});
// Or create a WebSocket server
createWebSocketServer({
port: 8080
});Client Side
To connect to the signaling server:
import { ConnectToSignaling } from '@lmkdbd/signaling';
const client = await ConnectToSignaling({
did_key: 'your-did-key',
signaling_url: 'your-signaling-server-url',
handler: yourHandlerImplementation,
register_data: yourRegistrationData
});Project Structure
/common- Common utilities and shared code/config- Configuration files/example- Example implementations and usage demos/handler- Signal handling implementations/pkg- Core package components/test- Test files
Dependencies
- @instun/did-key - DID key management
- @instun/drpc - DRPC implementation
- WebSocket support for real-time communication
Platform Support
The package includes specific implementations for different platforms:
- Browser
- React Native