mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-21 22:54:53 +08:00
Fix uncaught error in server
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user