centrifuge 5.3.2 → 5.3.3

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/README.md CHANGED
@@ -27,6 +27,7 @@ The features implemented by this SDK can be found in [SDK feature matrix](https:
27
27
  * [Protobuf support](#protobuf-support)
28
28
  * [Using with NodeJS](#using-with-nodejs)
29
29
  * [Custom WebSocket constructor](#custom-websocket-constructor)
30
+ * [Using with React Native on Android](#using-with-react-native-on-android)
30
31
  * [Run tests locally](#run-tests-locally)
31
32
 
32
33
  ## Install
@@ -817,6 +818,10 @@ var centrifuge = new Centrifuge('ws://localhost:8000/connection/websocket', {
817
818
 
818
819
  See a basic example with React Native where this technique is used [in this comment](https://github.com/centrifugal/centrifuge-js/issues/224#issuecomment-1538820023).
819
820
 
821
+ ## Using with React Native on Android
822
+
823
+ If you have issues with the connection on Android when using React Native – [check out this comment](https://github.com/centrifugal/centrifuge-js/issues/242#issuecomment-2569474401) – you may be using non-secure endpoint schemes and need to explicitly allow it.
824
+
820
825
  ## Run tests locally
821
826
 
822
827
  If you want to run `centrifuge-js` tests locally, start test Centrifugo server:
package/build/index.js CHANGED
@@ -1591,7 +1591,6 @@ class HttpStreamTransport {
1591
1591
  body: body,
1592
1592
  mode: 'cors',
1593
1593
  credentials: 'same-origin',
1594
- cache: 'no-cache'
1595
1594
  };
1596
1595
  fetchFunc(this.options.emulationEndpoint, fetchOptions);
1597
1596
  }
@@ -1676,7 +1675,6 @@ class SseTransport {
1676
1675
  body: body,
1677
1676
  mode: 'cors',
1678
1677
  credentials: 'same-origin',
1679
- cache: 'no-cache'
1680
1678
  };
1681
1679
  fetchFunc(this.options.emulationEndpoint, fetchOptions);
1682
1680
  }
@@ -2587,7 +2585,7 @@ class Centrifuge extends EventEmitter$1 {
2587
2585
  websocket: websocket
2588
2586
  });
2589
2587
  if (!this._transport.supported()) {
2590
- throw new Error('WebSocket not available');
2588
+ throw new Error('WebSocket constructor not found, make sure it is available globally or passed as a dependency in Centrifuge options');
2591
2589
  }
2592
2590
  }
2593
2591
  }
package/build/index.mjs CHANGED
@@ -1589,7 +1589,6 @@ class HttpStreamTransport {
1589
1589
  body: body,
1590
1590
  mode: 'cors',
1591
1591
  credentials: 'same-origin',
1592
- cache: 'no-cache'
1593
1592
  };
1594
1593
  fetchFunc(this.options.emulationEndpoint, fetchOptions);
1595
1594
  }
@@ -1674,7 +1673,6 @@ class SseTransport {
1674
1673
  body: body,
1675
1674
  mode: 'cors',
1676
1675
  credentials: 'same-origin',
1677
- cache: 'no-cache'
1678
1676
  };
1679
1677
  fetchFunc(this.options.emulationEndpoint, fetchOptions);
1680
1678
  }
@@ -2585,7 +2583,7 @@ class Centrifuge extends EventEmitter$1 {
2585
2583
  websocket: websocket
2586
2584
  });
2587
2585
  if (!this._transport.supported()) {
2588
- throw new Error('WebSocket not available');
2586
+ throw new Error('WebSocket constructor not found, make sure it is available globally or passed as a dependency in Centrifuge options');
2589
2587
  }
2590
2588
  }
2591
2589
  }