@soundworks/core 5.1.0 → 5.1.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## v5.1.1 - 2025-04-28
2
+
3
+ - Hotfix: run behind https proxy
4
+
5
+ ## v5.1.0 - 2025-02-19
6
+
7
+ - Feat: add SharedStateCollection reduce
8
+
1
9
  ## v5.0.3 - 2025-02-13
2
10
 
3
11
  - Fix: unexpected error when getting description of shared state class with required parameter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soundworks/core",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "description": "Open-source creative coding framework for distributed applications based on Web technologies",
5
5
  "collaborators": [
6
6
  "Benjamin Matuszewski",
@@ -61,13 +61,22 @@ class ClientSocket {
61
61
  path = `${this.#config.env.baseUrl}/${path}`;
62
62
  }
63
63
 
64
- const protocol = this.#config.env.useHttps ? 'wss:' : 'ws:';
65
- const port = this.#config.env.port;
64
+ let port = this.#config.env.port;
65
+ let protocol = this.#config.env.useHttps ? 'wss:' : 'ws:';
66
66
  let serverAddress;
67
67
  let webSocketOptions;
68
68
 
69
69
  if (isBrowser()) {
70
70
  const hostname = window.location.hostname;
71
+ // ## Hotfix - 20250428
72
+ // when running behind an https proxy (e.g. nginx) `useHttps` can be false
73
+ // but we need to open the socket in secure protocol
74
+ // This tends to confirm that we need more granularity with this config
75
+ // stuff, there are too much weird edge cases to handle
76
+ if (this.#config.env.useHttps === false && window.location.protocol === 'https:') {
77
+ protocol = 'wss:';
78
+ port = 443;
79
+ }
71
80
 
72
81
  if (this.#config.env.serverAddress === '') {
73
82
  serverAddress = hostname;
@@ -1,2 +1,2 @@
1
1
  // [WARNING] This file is generated, do not edit
2
- export default '5.1.0';
2
+ export default '5.1.2';
@@ -1,2 +1,2 @@
1
- declare const _default: "5.1.0";
1
+ declare const _default: "5.1.2";
2
2
  export default _default;