Giter Site home page Giter Site logo

elm-allo's Introduction

Allo

Videoconference WebRTC example with an Elm frontend. Requires https. More info in the post on Elm discourse.

screenshots

Setup and Run

# Install node packages
npm install

# Start the server
npm start

Heroku setup

git clone https://github.com/mpizenberg/elm-allo.git
cd elm-allo
heroku login
heroku create
git push heroku master

Nginx Reverse Proxy Configuration

http {
	server { ... }
	server { ... }
	server {
		server_name subdomain.domain.com;
		location / {
			# Special treatment to handle WebSocket hop-by-hop headers
			proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "upgrade";

			# Standard proxy
			proxy_pass http://localhost:8443;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Forwarded-Proto $scheme;
		}
		# ... stuff added by Certbot for SSL
	}
}

WebRTC Negotiation

Establishing a connection between two peers requires first a negotiation between each client. The server has the broker's role by relaying all messages between those peers.

All the WebRTC-specific code, including negotiation, is located in the public/WebRTCClient.js file. A high-level API is provided with the WebRTCCLient() function. Intermediate-level APIs are also provided with the SignalingSocket() and PeerConnection() functions. The core of the negotiation logic lives inside the Peerconnection() function. Two negotiation algorithms are implemented, but only one is activated.

The first negotiation algorithm follows a simple caller/callee pattern. It corresponds to the simpleNegotiation() function.

The second negotiation algorithm is called perfect negotiation. Both peers are considered equally and it tries to handle peer changes of states without glare (signaling collisions). A very useful blog post by Jan-Ivar Bruaroey introduces the perfect negotiation pattern. Unfortunately, browsers still have some issues preventing the usage of this pattern so it has been deactivated in our code. This corresponds to the perfectNegotiation() function.

elm-allo's People

Contributors

mpizenberg avatar ktorz avatar

Watchers

James Cloos 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.