swrtc-signal-server
v0.3.3
Published
A not-garbage recode of signalmaster for SimpleWebRtc
Downloads
7
Readme
swrtc-signal-server
This library mimics the signal-server signalmaster for SimpleWebRTC with some important changes.
- Supports
socket.io >= 1.3.0
- Sane API
Why
SimpleWebRtc is garbage in terms of code quality, API and documentation. We all know that, but it's the least garbage library for webrtc which is being currently maintained (as of July 2015).
It is programmatic friendly and not tied to a .json
file.
SignalServer = require 'swrtc-signal-server'
SocketIo = require 'socket.io'
http = require 'http'
server = new http.Server (req, res) ->
res.writeHead 404
res.end('404')
server.listen 1300
io = SocketIo.listen server
swrtc = new SignalServer {
rooms:
maxClients: 0
turnservers: []
stunservers: []
io: io
}
#
# or
#
swrtc = new SignalServer {
server: server = new require('http').Server().listen()
# or
server: { host: '0.0.0.0', port: 1300 }
io: require('socket.io')( server )
# or
io: null # Will use the above http server or config
}
# Woo...
Eventually when a better library surfaces/I create it out of searing frustration, this library can then be trashed.
Further API
View the source code for more information.
Install
npm install swrtc-signal-server