snapdrop

A Progressive Web App for local file sharing
git clone http://git.hanabi.in/repos/snapdrop.git
Log | Files | Refs | README | LICENSE

commit e6f35556190e1ff524a09191766dc0e2bbccbce5
parent 8b99e921e7a838b5d08a3dfefa1ba53721a4fc25
Author: JBYoshi <12983479+JBYoshi@users.noreply.github.com>
Date:   Mon, 18 Feb 2019 15:46:11 -0600

Merge remote-tracking branch 'origin/master' into localhost

Diffstat:
MREADME.md | 3+++
Mclient/scripts/network.js | 11+++++++----
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -51,7 +51,10 @@ ShareDrop uses WebRTC only and isn't compatible with Safari browsers. Snapdrop u # open a second shell: cd snapdrop/client + # Python 2 python -m SimpleHTTPServer + # Python 3 + python3 -m http.server ``` Now point your browser to http://localhost:8000. diff --git a/client/scripts/network.js b/client/scripts/network.js @@ -273,8 +273,12 @@ class RTCPeer extends Peer { if (message.sdp) { this._conn.setRemoteDescription(new RTCSessionDescription(message.sdp)) - .then( _ => this._conn.createAnswer()) - .then(d => this._onDescription(d)) + .then( _ => { + if (message.sdp.type === 'offer') { + return this._conn.createAnswer() + .then(d => this._onDescription(d)); + } + }) .catch(e => this._onError(e)); } else if (message.ice) { this._conn.addIceCandidate(new RTCIceCandidate(message.ice)); @@ -510,4 +514,4 @@ RTCPeer.config = { credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', username: '28224511:1379330808' }] -} -\ No newline at end of file +}