GithubHelp home page GithubHelp logo

monogramm / talk-signalmaster Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 4.0 50 KB

:telephone_receiver: Simple socket.io server for NextCloud WebRTC signaling

Home Page: https://github.com/nextcloud/spreed

License: GNU Affero General Public License v3.0

Dockerfile 7.21% Shell 3.30% JavaScript 68.52% HTML 20.97%
webrtc signaling javascript nextcloud video call screensharing

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

talk-signalmaster's People

Contributors

madmath03 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

talk-signalmaster's Issues

Working? :)

I was wondering if you ever got this actually working? :)

Nextcloud Talk 8.0.7 on Nextcloud 18.0.3 Participants Empty, no Communication

Hello,

i've tryed to use your selfhosted Signalserver for my Nextcloud Environment make it possible to talk more then 4 Persons with Video.

Unfortunately the whole Talk stucks while getting the Participants.
Spinning wheel on chat messages, doubleing messages.

This is my Environment:
Nextcloud: Ubuntu 18.04 LTS, Postgresql
Turnserver: coturn <seperate Ubuntu 18.04 LTS Machine>
Talk-Signalmaster <seperate Ubuntu 18.04 LTS Machine>

Config for Turnserver:

listening-port=3478
listening-ip=10.10.20.110
relay-ip=10.10.20.110
fingerprint
use-auth-secret
static-auth-secret=<mycoturnsecret>
realm=<mynextcloud-fqdn>
#user-quota=0
total-quota=100
no-stun
no-loopback-peers
no-multicast-peers

Talk-Signalmaster Start Parameters:
NODE_ENV=production STUN_SERVER_DOMAIN=stun.nextcloud.com STUN_SERVER_PORT=443 TURN_SERVER_DOMAIN=<mycoturn fqdn> TURN_SERVER_PORT=3478 TURN_SERVER_SECRET=<mycoturnsecret> ALLOWED_ORIGIN=<mynextcloud-fqdn> NEXTCLOUD_SHARED_SECRET=<mynextcloud-signalsecret> node server.js

The Talk-Signalmaster is running:
NextCloud Talk -- HTTP server is running at 'https://localhost:8888'
NextCloud Talk -- signal master is running at 'wss://localhost:8888'

Nextcloud Talk Settings:
STUN-Servers: stun.nextcloud.com:443
TURN-Servers: :3478 #is working for both udp/tcp
Signaling-Servers: wss://:8888
Shared Secret:

I have tested it with the .env File with following entrys as well:

HOST=10.10.20.48
PORT=8888
ROOM_MAX_CLIENTS=0
STUN_SERVER_DOMAIN=stun.nextcloud.com
STUN_SERVER_PORT=443
TURN_SERVER_DOMAIN=<myturnserver-fqdn>
TURN_SERVER_PORT=3478
TURN_SERVER_SECRET=<myturnsecret>
NEXTCLOUD_SHARED_SECRET=<mynextcloudsecret>
ALLOWED_ORIGIN=<mynextcloud-fqdn>
SSL_KEY=./sslcerts/key.pem
SSL_CERT=./sslcerts/cert.pem
SSL_PASSWORD=

Followed by the start with: NODE_ENV=production node server.js
Following Console errors:

NextCloud Talk -- HTTP server is running at 'https://10.10.20.48:8888'
NextCloud Talk -- signal master is running at 'wss://10.10.20.48:8888'

[2020-04-09T07:37:16.186Z] - Connection from origin undefined rejected.

All Ports are forwared to the Ubuntu Maschine with talk-signalmaster and turn as well.
I can open the Ports from external.

Talk is working without Signalconfig but any details are greyed out while using talk-signalmaster.
Did i anything wrong.

I please your support to get the stuff working within the corone epidemic time.

Thanks a lot and best regards

Patrick

P.S. this is logged in the nextcloud.log

{"reqId":"FovFfJyDR8oCASLRWfOd","level":3,"time":"2020-04-09T09:28:23+02:00","remoteAddr":"79.250.148.227","user":"08598A5C-6FB6-450C-A152-628B33F56156","app":"no app in context","method":"DELETE","url":"/ocs/v2.php/apps/spreed/api/v1/call/jdq2o9df","message":{"Exception":"GuzzleHttp\\Exception\\ClientException","Message":"Client error: `POST https://<mynextcloud-fqdn>:8888/api/v1/room/jdq2o9df` resulted in a `404 Not Found` response","Code":404,"Trace":[{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":66,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":[{"__class__":"GuzzleHttp\\Psr7\\Request"},"*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":203,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":156,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":[1,"*** sensitive parameter replaced ***",[{"__class__":"GuzzleHttp\\Promise\\Promise"},{"__class__":"Closure"},null]]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":47,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":246,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->","args":[true]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":223,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":267,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":225,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":131,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/Http/Client/Client.php","line":217,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["post","https://<mynextcloud-fqdn>:8888/api/v1/room/jdq2o9df",{"proxy":null,"verify":false,"timeout":30,"headers":{"Content-Type":"application/json","Spreed-Signaling-Random":"4YL7ceQMJa89hGhqa2EwcOrYxgNpR5ptyt+povZEQzWPZRT1lS54UhR75RjE+3fm","Spreed-Signaling-Checksum":"3da1ec0dc6c793d12cf767038211052b0c79bd775de02ce18ebf350966469634","User-Agent":"Nextcloud Server Crawler"},"body":"{\"type\":\"incall\",\"incall\":{\"incall\":0,\"changed\":[{\"inCall\":0,\"lastPing\":1586417296,\"sessionId\":\"Elh\\/D0R8ylKLRjosa7lbuH3ymwjixBXdSJNoDsPQLvkgcK3YSBhsBfti\\/t3rZzahTDHLqqZJlZJViQYgugSwPOssxEt6JSWPp4N5HuQ95khF82Yp5yUgXFdFgZu9KAYa0+tVr7Q0\\/iC44DMAu7G0e\\/M+2rliwaZMZCxapS5zY+0pF3v0Z08uG7\\/omJ4Uzf27FB+OrIituUV7tSYZqd1psgzvzQfu6Ysvniztl2\\/pfOKao11KrS7PBV7KbpBRiCx\",\"participantType\":1,\"userId\":\"08598A5C-6FB6-450C-A152-628B33F56156\"}],\"users\":[]}}","synchronous":true}]},{"file":"/var/www/nextcloud/apps/spreed/lib/Signaling/BackendNotifier.php","line":69,"function":"post","class":"OC\\Http\\Client\\Client","type":"->","args":["https://<mynextcloud-fqdn>:8888/api/v1/room/jdq2o9df",{"headers":{"Content-Type":"application/json","Spreed-Signaling-Random":"4YL7ceQMJa89hGhqa2EwcOrYxgNpR5ptyt+povZEQzWPZRT1lS54UhR75RjE+3fm","Spreed-Signaling-Checksum":"3da1ec0dc6c793d12cf767038211052b0c79bd775de02ce18ebf350966469634"},"body":"{\"type\":\"incall\",\"incall\":{\"incall\":0,\"changed\":[{\"inCall\":0,\"lastPing\":1586417296,\"sessionId\":\"Elh\\/D0R8ylKLRjosa7lbuH3ymwjixBXdSJNoDsPQLvkgcK3YSBhsBfti\\/t3rZzahTDHLqqZJlZJViQYgugSwPOssxEt6JSWPp4N5HuQ95khF82Yp5yUgXFdFgZu9KAYa0+tVr7Q0\\/iC44DMAu7G0e\\/M+2rliwaZMZCxapS5zY+0pF3v0Z08uG7\\/omJ4Uzf27FB+OrIituUV7tSYZqd1psgzvzQfu6Ysvniztl2\\/pfOKao11KrS7PBV7KbpBRiCx\",\"participantType\":1,\"userId\":\"08598A5C-6FB6-450C-A152-628B33F56156\"}],\"users\":[]}}","verify":false}]},{"file":"/var/www/nextcloud/apps/spreed/lib/Signaling/BackendNotifier.php","line":111,"function":"doRequest","class":"OCA\\Talk\\Signaling\\BackendNotifier","type":"->","args":["https://<mynextcloud-fqdn>:8888/api/v1/room/jdq2o9df",{"headers":{"Content-Type":"application/json","Spreed-Signaling-Random":"4YL7ceQMJa89hGhqa2EwcOrYxgNpR5ptyt+povZEQzWPZRT1lS54UhR75RjE+3fm","Spreed-Signaling-Checksum":"3da1ec0dc6c793d12cf767038211052b0c79bd775de02ce18ebf350966469634"},"body":"{\"type\":\"incall\",\"incall\":{\"incall\":0,\"changed\":[{\"inCall\":0,\"lastPing\":1586417296,\"sessionId\":\"Elh\\/D0R8ylKLRjosa7lbuH3ymwjixBXdSJNoDsPQLvkgcK3YSBhsBfti\\/t3rZzahTDHLqqZJlZJViQYgugSwPOssxEt6JSWPp4N5HuQ95khF82Yp5yUgXFdFgZu9KAYa0+tVr7Q0\\/iC44DMAu7G0e\\/M+2rliwaZMZCxapS5zY+0pF3v0Z08uG7\\/omJ4Uzf27FB+OrIituUV7tSYZqd1psgzvzQfu6Ysvniztl2\\/pfOKao11KrS7PBV7KbpBRiCx\",\"participantType\":1,\"userId\":\"08598A5C-6FB6-450C-A152-628B33F56156\"}],\"users\":[]}}","verify":false}]},{"file":"/var/www/nextcloud/apps/spreed/lib/Signaling/BackendNotifier.php","line":292,"function":"backendRequest","class":"OCA\\Talk\\Signaling\\BackendNotifier","type":"->","args":["https://<mynextcloud-fqdn>:8888/api/v1/room/jdq2o9df",{"type":"incall","incall":{"incall":0,"changed":[{"inCall":0,"lastPing":1586417296,"sessionId":"Elh/D0R8ylKLRjosa7lbuH3ymwjixBXdSJNoDsPQLvkgcK3YSBhsBfti/t3rZzahTDHLqqZJlZJViQYgugSwPOssxEt6JSWPp4N5HuQ95khF82Yp5yUgXFdFgZu9KAYa0+tVr7Q0/iC44DMAu7G0e/M+2rliwaZMZCxapS5zY+0pF3v0Z08uG7/omJ4Uzf27FB+OrIituUV7tSYZqd1psgzvzQfu6Ysvniztl2/pfOKao11KrS7PBV7KbpBRiCx","participantType":1,"userId":"08598A5C-6FB6-450C-A152-628B33F56156"}],"users":[]}}]},{"file":"/var/www/nextcloud/apps/spreed/lib/Signaling/Listener.php","line":205,"function":"roomInCallChanged","class":"OCA\\Talk\\Signaling\\BackendNotifier","type":"->","args":[{"__class__":"OCA\\Talk\\Room"},0,["Elh/D0R8ylKLRjosa7lbuH3ymwjixBXdSJNoDsPQLvkgcK3YSBhsBfti/t3rZzahTDHLqqZJlZJViQYgugSwPOssxEt6JSWPp4N5HuQ95khF82Yp5yUgXFdFgZu9KAYa0+tVr7Q0/iC44DMAu7G0e/M+2rliwaZMZCxapS5zY+0pF3v0Z08uG7/omJ4Uzf27FB+OrIituUV7tSYZqd1psgzvzQfu6Ysvniztl2/pfOKao11KrS7PBV7KbpBRiCx"]]},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":247,"function":"OCA\\Talk\\Signaling\\{closure}","class":"OCA\\Talk\\Signaling\\Listener","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[[{"__class__":"Closure"},{"__class__":"Closure"},{"__class__":"Closure"},{"__class__":"Closure"}],"*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":80,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/apps/spreed/lib/Room.php","line":918,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/apps/spreed/lib/Controller/CallController.php","line":115,"function":"changeInCall","class":"OCA\\Talk\\Room","type":"->","args":[{"__class__":"OCA\\Talk\\Participant"},0]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"leaveCall","class":"OCA\\Talk\\Controller\\CallController","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Talk\\Controller\\CallController"},"leaveCall"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Talk\\Controller\\CallController"},"leaveCall"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Talk\\Controller\\CallController","leaveCall",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"apiVersion":"v1","token":"jdq2o9df","_route":"ocs.spreed.Call.leaveCall"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"apiVersion":"v1","token":"jdq2o9df","_route":"ocs.spreed.Call.leaveCall"}]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":299,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"apiVersion":"v1","token":"jdq2o9df","_route":"ocs.spreed.Call.leaveCall"}]},{"file":"/var/www/nextcloud/ocs/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/spreed/api/v1/call/jdq2o9df"]},{"file":"/var/www/nextcloud/ocs/v2.php","line":24,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Android) Nextcloud-Talk v8.0.8","version":"18.0.3.0","id":"5e8ece984cea8"}

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.