@abraca/dabra 1.0.6 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/dabra",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "abracadabra provider",
5
5
  "keywords": [
6
6
  "abracadabra",
@@ -102,7 +102,8 @@ export class AbracadabraWebRTC extends EventEmitter {
102
102
  "";
103
103
  const httpUrl = wsUrl
104
104
  .replace(/^wss:/, "https:")
105
- .replace(/^ws:/, "http:");
105
+ .replace(/^ws:/, "http:")
106
+ .replace(/\/ws\/?$/, "");
106
107
 
107
108
  return new AbracadabraWebRTC({
108
109
  docId: config.name,
@@ -50,6 +50,8 @@ export class ManualSignaling extends EventEmitter {
50
50
  */
51
51
  async createOfferBlob(): Promise<ManualSignalingBlob> {
52
52
  this.pc = new RTCPeerConnection({ iceServers: this.iceServers });
53
+ // A data channel is required for ICE gathering to produce candidates.
54
+ this.pc.createDataChannel("manual-signaling");
53
55
 
54
56
  const candidates: string[] = [];
55
57
  const gatheringComplete = new Promise<void>((resolve) => {
@@ -84,6 +86,7 @@ export class ManualSignaling extends EventEmitter {
84
86
  */
85
87
  async acceptOffer(offerBlob: ManualSignalingBlob): Promise<ManualSignalingBlob> {
86
88
  this.pc = new RTCPeerConnection({ iceServers: this.iceServers });
89
+ this.pc.createDataChannel("manual-signaling");
87
90
 
88
91
  const candidates: string[] = [];
89
92
  const gatheringComplete = new Promise<void>((resolve) => {