You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Table of contents:

  1. General parameters for webrtc app
  2. Our signal server on Java
  3. Native client and MCU server

General parameters for webrtc app

First of all I define a "webrtc" term. Webrtc is a set of APIs for work with:

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

Secondly I describe two specials servers for establishing connection between peers.

Mostly devices in the Internet have gray IP addresses. They connect to the Internet via provides.

Providers have a lot of clients and small pool of public (white) IP addresses therefore they assign one public IP to one active client.

It can be done in various ways. This process is called NAT - network address translation. There are two big type of NAT - symmetric and asymmetric.

Both can translates IP address and ports. One assigns IP for a long time but second do it for each request.

There are two servers - STUN and TURN. First is necessary for discovering your public IP address if you have gray address.

For example - you send some special message to the STUN and it responses with your NAT.

In order that establish connection between peers in the Internet you must:

  1. discover public IP address via STUN server
  2. if your NAT is dynamic thus STUN server doesn't help you and you must use TURN server that can transmit your data over the net
  3. create RTCPeerConnection and etc (see Our signal server on Java paragraph)

There are many public STUN/TURN servers - https://gist.github.com/zziuni/3741933.

Also there are many open source java implementation of STUN/TURN protocols and servers.

I'm using a public google stun server for demo app. It doesn't support TURN mode but work fine for my local provider.

To sum up for our webrtc scheme you need have two servers - STUN and TURN.

Our signal server on Java

 

  • No labels