Giter VIP home page Giter VIP logo

rust-webrtc-client-server-example's Introduction

Rust WebRTC Client-Server example

About

An example with WebRTC-client and WebRTC-server. Network model is Client-Server-Client.

WebRTC-client works in two modes: sender or receiver. In sender mode, it sends text and video data to the server. The WebRTC server forwards data from one sender client to a receiver client.

The client side of this example uses async rust and web-sys including the use of WebRTC. The server side of this example uses async rust, WebSocket using tokio-tungstenite and WebRTC using webrtc-rs.

In order to simplify the code, all the errors are unwrapped.

State

  • Signaling protocol,
  • Signaling server,
  • Multiple clients per server,
  • Sender-Client-To-Server WebRTC-connection,
  • Sender-Client-To-Server text,
  • Sender-Client-To-Server video,
  • Sender-Client-To-Server audio,
  • Sender-Client-To-Server video and audio as a single stream,
  • Server-To-Receiver-Client WebRTC-connection,
  • Server-To-Receiver-Client text,
  • Server-To-Receiver-Client video,
  • Server-To-Receiver-Client audio,
  • Server-To-Receiver-Client video and audio as a single stream,
  • Each Sender-Client paired with the Receiver-Client,
  • Data transfer from Sender-Client to Receiver-Client via server,
  • Media transfer from Sender-Client to Receiver-Client via server.

Setup

  • Run bash setup.sh

Usage

  • Run bash watch.sh
  • Open localhost:8080 in browser
  • Edit the server address if necessary and click button Start sender or Start receiver.
  • Type in sender TextArea, the message will be displayed on the receiver TextArea.
  • If the receiver is started before the sender, you will see the video as soon as the sender is started.
  • If the sender starts before the receiver, the video will start after the sender sends keyframes.
  • A separate HtmlVideoElement is used for audio playback on the Client-Receiver side.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

rust-webrtc-client-server-example's People

Contributors

zheland avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.