webrtc-signal-server

Crates.iowebrtc-signal-server
lib.rswebrtc-signal-server
version0.1.1
created_at2025-05-08 09:23:15.705697+00
updated_at2025-05-08 09:53:34.909631+00
descriptionGeneral WebRTC signal server For Peer to Peer Communication
homepage
repositoryhttps://github.com/stars-labs/cypto-rust-tools
max_upload_size
id1665067
size28,871
Freeman.Xiong (xiongchenyu6)

documentation

README

webrtc-signal-server

A general WebRTC signal server for peer-to-peer communication, written in Rust and powered by async networking and WebSockets.

Features

  • Simple WebSocket-based signaling for WebRTC peers
  • Peer registration and discovery
  • Message relay between peers
  • Asynchronous, scalable, and easy to deploy

Usage

Add to your workspace or build as a standalone binary:

cargo build --release

Run the server (default port: 9000):

cargo run --release

The server listens for WebSocket connections on 0.0.0.0:9000.

Protocol

Clients communicate with the server using JSON messages:

Register

{ "type": "register", "peer_id": "your-unique-id" }

List Peers

{ "type": "list_peers" }

Relay Message

{ "type": "relay", "to": "target-peer-id", "data": { ... } }

Server Responses

  • List of peers:
    { "type": "peers", "peers": ["peer1", "peer2"] }
    
  • Relayed message:
    { "type": "relay", "from": "peer1", "data": { ... } }
    
  • Error:
    { "type": "error", "error": "description" }
    

License

MIT OR Apache-2.0

Repository

https://github.com/stars-labs/cypto-rust-tools

Commit count: 0

cargo fmt