]>
git.r.bdr.sh - rbdr/junction/blob - server/events.js
bad9046f2f14fff4313b1af16d797a46e9b6e7a8
2 emitter(name
, data
, socket
) {
3 socket
.emit(name
, data
);
4 console
.debug(`[${name}] ${JSON.stringify(data)}`);
10 CONNECTION: "connection",
12 DISCONNECTING: "disconnecting",
13 RELAY_ICE_CANDIDATE: "relayICECandidate",
14 RELAY_OFFER: "relayOffer",
15 RELAY_ANSWER: "relayAnswer",
19 REMOVE_PEER: "removePeer",
20 OFFER_RECEIVED: "offerReceived",
21 ANSWER_RECEIVED: "answerReceived",
22 ICE_CANDIDATE_RECEIVED: "ICECandidateReceived",
25 export function addPeer(peerId
) {
26 return internals
.emitter
.bind(null, types
.ADD_PEER
, {
31 export function removePeer(peerId
) {
32 return internals
.emitter
.bind(null, types
.REMOVE_PEER
, {
37 export function ICECandidateReceived(peerId
, candidate
) {
38 return internals
.emitter
.bind(null, types
.ICE_CANDIDATE_RECEIVED
, {
44 export function offerReceived(peerId
, offer
) {
45 return internals
.emitter
.bind(null, types
.OFFER_RECEIVED
, {
51 export function answerReceived(peerId
, answer
) {
52 return internals
.emitter
.bind(null, types
.ANSWER_RECEIVED
, {