Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Capturing user media - get stream from camera or microphone via browser
  • RTCPeerConnection which that manage video/audio calls
  • RTCDataChannel that allows to transmit custom data between peers if they already have established connection

...

Our signal server on Java

...

Establishing connection between peers demands one more public server - a Signal server.

...

This is a short description how to connect two peers because client must exchange ice candidates too but it's similar on offer/answer exchanging.

The following picture illustrates typical work-flow.

 Image Added

Our signal server.

Our signal server uses JSON format for message and work via websocketweb-socket's protocol.

Why have I used JSON and websocketsweb-sockets? Because JSON is a main native format for JS in browses and websocket browsers and the web-socket is the fastest protocol for reliable connections.

Also web-sockets are integrated into JS and are supported by all modern browsers.

A structure of particular packet you can see in the code. It's attached to the this documentation.

Our signal server works under red5 server and uses tomcat-embedded web-sockets.

The RTCPeerConnection API is oriented on p2p connections but our signal server also supports room.

You can create a new room just via sending createRoom message and you can connect to the room by id.

I've taken care about the flood attack on server so when you connect to the room you shouldn't create RTCPeer object and allocate any resources.

Signal server transmit your connect message to all other clients in the room and they send your offer later.

A few words about demo client in browser - it's written on JS supports our signal server but It can be improved via using some cross-browser library for RTCPeerConnection (https://github.com/otalk/rtcpeerconnection).