hsync 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hsync.js +2 -2
- package/dist/hsync.min.js +1 -1
- package/lib/peers.js +6 -2
- package/lib/rtc-web.js +1 -1
- package/package.json +1 -1
package/lib/peers.js
CHANGED
|
@@ -89,13 +89,15 @@ function createRPCPeer(options = {}) {
|
|
|
89
89
|
const [p1, p2, p3] = msg.topic.split('/');
|
|
90
90
|
if (p1 === 'rpc') {
|
|
91
91
|
transport.receiveData(JSON.parse(msg.payload.toString()));
|
|
92
|
-
} else if (p1 === 'socketData'){
|
|
92
|
+
} else if (p1 === 'socketData') {
|
|
93
93
|
handleSocketPacket(msg);
|
|
94
|
+
} else if (p1 === 'test') {
|
|
95
|
+
debug('test topic', msg.payload);
|
|
94
96
|
} else {
|
|
95
97
|
debug('other topic', msg.topic);
|
|
96
98
|
}
|
|
97
99
|
} catch (e) {
|
|
98
|
-
debug('bad packet', e);
|
|
100
|
+
debug('bad packet', e, packet);
|
|
99
101
|
}
|
|
100
102
|
});
|
|
101
103
|
|
|
@@ -105,6 +107,8 @@ function createRPCPeer(options = {}) {
|
|
|
105
107
|
const packet = createPacket(topic, payload);
|
|
106
108
|
peer.rtcSend(packet);
|
|
107
109
|
}
|
|
110
|
+
// firefox is weird about the first bit of data, so send a test packet
|
|
111
|
+
peer.packAndSend('test', 'test');
|
|
108
112
|
});
|
|
109
113
|
|
|
110
114
|
peer.rtcEvents.on('closed', () => {
|
package/lib/rtc-web.js
CHANGED