From 36ec13d4285b1d8633cc3bddd26df8fddbb8e59e Mon Sep 17 00:00:00 2001 From: RobinLinus Date: Fri, 21 Sep 2018 18:53:31 +0200 Subject: [PATCH] Fix uncaught error in server --- README.md | 4 ++-- client/scripts/network-v2.js | 34 ---------------------------------- server/index.js | 2 +- 3 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 client/scripts/network-v2.js diff --git a/README.md b/README.md index eb9f9c4..0744ba4 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ ShareDrop uses WebRTC only and isn't compatible with Safari Browsers. Snapdrop u ## Local Development ``` - git clone git@github.com:RobinLinus/secret-snapdrop.git - cd secret-snapdrop/server + git clone git@github.com:RobinLinus/snapdrop.git + cd snapdrop/server npm install node index.js cd ../client diff --git a/client/scripts/network-v2.js b/client/scripts/network-v2.js deleted file mode 100644 index 7a15cbd..0000000 --- a/client/scripts/network-v2.js +++ /dev/null @@ -1,34 +0,0 @@ -class ServerConnection { - -} - -class Connection { - -} - -class WSConnection extends Connection { - -} - -class RTCConnection extends Connection { - -} - -class Peer { - - constructor(serverConnection) { - this._ws = new WSConnection(serverConnection); - this._rtc = new RTCConnection(serverConnection); - this._fileReceiver = new FileReceiver(this); - this._fileSender = new FileSender(this); - } - - send(message) { - - } - -} - -class Peers { - -} \ No newline at end of file diff --git a/server/index.js b/server/index.js index 2d8bbfd..52ecc7a 100644 --- a/server/index.js +++ b/server/index.js @@ -39,7 +39,7 @@ class SnapdropServer { } // relay message to recipient - if (message.to) { + if (message.to && this._rooms[sender.ip]) { const recipientId = message.to; // TODO: sanitize const recipient = this._rooms[sender.ip][recipientId]; delete message.to;