SOURCE -> PEER
This commit is contained in:
parent
1c5b22c93c
commit
6475fa0c37
@ -37,19 +37,8 @@ function PeerServer(options) {
|
||||
|
||||
switch (message.type) {
|
||||
// Source connected -- send back its ID.
|
||||
case 'SOURCE':
|
||||
socket.send(JSON.stringify({ type: 'SOURCE-ID', id: clientId }));
|
||||
break;
|
||||
// Sink connected -- send back its ID and notify src.
|
||||
case 'SINK':
|
||||
if (!!message.source && !!self.clients[message.source]) {
|
||||
self.clients[message.source].send(JSON.stringify({
|
||||
type: 'SINK-CONNECTED', sink: clientId }));
|
||||
|
||||
socket.send(JSON.stringify({ type: 'SINK-ID', id: clientId }));
|
||||
} else {
|
||||
util.prettyError('source invalid');
|
||||
}
|
||||
case 'PEER':
|
||||
socket.send(JSON.stringify({ type: 'ID', id: clientId }));
|
||||
break;
|
||||
case 'LEAVE':
|
||||
if (!!self.clients[message.dst]) {
|
||||
|
@ -7,7 +7,10 @@
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node server.js"
|
||||
},
|
||||
"repository": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/michellebu/peerjs-server.git"
|
||||
},
|
||||
"author": "Michelle Bu",
|
||||
"license": "BSD",
|
||||
"dependencies": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user