Giter Club home page Giter Club logo

talk-signalmaster's Introduction

License: AGPL v3 Managed with Taiga.io Build Status Docker Cloud Build Status Docker Pulls Docker layers

⚠️ This project is no longer necessary since NextCloud OpenSourced their high performance signaling server ❤️

talk-signalmaster

A simple signaling server for NextCloud Talk to connect and do signaling for WebRTC.

This repository aims to provide a default connection point for NextCloud Talk. It was created from the simple signalmaster for SimpleWebRTC.js, whose open-source version has now been deprecated.

It also supports vending STUN/TURN servers with the shared secret mechanism as described in this draft. This mechanism is implemented e.g. by rfc-5766-turn-server or by a patched version of restund.

Read more:

This project is (currently) using WebSocket-Node.

Running

Running the server requires a valid installation of node.js which can be installed from the nodejs.org website. After installing the package you will need to install the node dependencies.

  1. npm install

  2. run the server using node server.js

  3. In the console you will see a message which tells you where the server is running:

     "NextCloud Talk -- HTTP server is running at: http://localhost:8888"
     "NextCloud Talk -- signal master is running at: ws://localhost:8888"
    

Testing

You can run unit tests with node:

  1. npm install

  2. run the test using node test.js

You can also use a simple web page. Simply open the test.html file in your browser to messages exchange with the Web Socket.

Production Environment

  • generate your ssl certs
$ ./scripts/generate-ssl-certs.sh
  • run in Production mode
$ NODE_ENV=production STUN_SERVER_DOMAIN=your.turn.servers.here STUN_SERVER_PORT=5449 TURN_SERVER_DOMAIN=your.turn.servers.here TURN_SERVER_PORT=5449 TURN_SERVER_SECRET=turnserversharedsecret ALLOWED_ORIGIN=.* NEXTCLOUD_SHARED_SECRET=nextcloudserversharedsecret node server.js

Use with Express

var express = require('express')
var sockets = require('signalmaster/sockets')

var app = express()
var server = app.listen(port)
sockets(server, config) // config is the same that server.js uses

Docker

You can build then run this image by calling:

docker build -t talk-signalmaster https://github.com/Monogramm/talk-signalmaster
docker run --name signalmaster -d -p 8888:8888 talk-signalmaster

To run the image from Dockerhub execute this:

docker run --name signalmaster -d -p 8888:8888 monogramm/docker-talk-signalmaster

This will start a signal master server on port 8888 exposed on port 8888.

By default, the docker image will run as production.

Environment variables:

HOST=localhost
PORT=8888
ROOM_MAX_CLIENTS=0
STUN_SERVER_DOMAIN=stun.l.google.com
STUN_SERVER_PORT=19302
TURN_SERVER_DOMAIN=
TURN_SERVER_PORT=
TURN_SERVER_SECRET=
SSL_KEY=./sslcerts/key.pem
SSL_CERT=./sslcerts/cert.pem
SSL_PASSWORD=
ALLOWED_ORIGIN=cloud.domain.com

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.