@stonyx/sockets 0.1.1-beta.44 → 0.1.1-beta.46

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.
Files changed (2) hide show
  1. package/README.md +18 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -205,11 +205,28 @@ Configuration is read from `stonyx/config` under `sockets`:
205
205
  | Option | Env Var | Default | Description |
206
206
  |--------|---------|---------|-------------|
207
207
  | `port` | `SOCKET_PORT` | `2667` | WebSocket server port |
208
- | `address` | `SOCKET_ADDRESS` | `ws://localhost:2667` | Client connection address |
208
+ | `address` | `SOCKET_ADDRESS` | `ws://localhost:{port}` | Client connection address |
209
209
  | `authKey` | `SOCKET_AUTH_KEY` | `'AUTH_KEY'` | Shared authentication key |
210
210
  | `heartBeatInterval` | `SOCKET_HEARTBEAT_INTERVAL` | `30000` | Heartbeat interval in ms |
211
211
  | `handlerDir` | `SOCKET_HANDLER_DIR` | `'./socket-handlers'` | Handler directory path |
212
+ | `log` | `SOCKET_LOG` | `false` | Enable verbose logging |
212
213
  | `encryption` | `SOCKET_ENCRYPTION` | `'true'` | Enable AES-256-GCM encryption |
214
+ | `reconnectBaseDelay` | `SOCKET_RECONNECT_BASE_DELAY` | `1000` | Base delay in ms for reconnect backoff |
215
+ | `reconnectMaxDelay` | `SOCKET_RECONNECT_MAX_DELAY` | `60000` | Ceiling in ms for reconnect backoff |
216
+ | `maxReconnectAttempts` | `SOCKET_MAX_RECONNECT_ATTEMPTS` | `Infinity` | Reconnect attempts before giving up |
217
+
218
+ That is every variable `config/environment.js` reads -- all ten. `authData`
219
+ (`{}`), `logColor` (`'white'`) and `logMethod` (`'socket'`) are also part of the
220
+ resolved config but are not settable from the environment. No environment value
221
+ is coerced: each resolves as the string the shell supplied.
222
+
223
+ > **If your app consumes this package and runs its own test suite:** pin all ten
224
+ > of these in your own `test/config/environment.js`, and keep `port` and
225
+ > `address` coupled -- `address` is computed from `port` at module-eval time, so
226
+ > pinning `port` alone does not move it. This package reads these variables
227
+ > unconditionally, so a `NODE_ENV=test` run in a shell that exports
228
+ > `SOCKET_ADDRESS` will dial whatever it names and send `authKey` to it. See
229
+ > [docs/configuration.md](docs/configuration.md#why-all-ten-keys-are-pinned).
213
230
 
214
231
  ## API Reference
215
232
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.1.1-beta.44",
7
+ "version": "0.1.1-beta.46",
8
8
  "description": "WebSocket server and client module for the Stonyx framework",
9
9
  "main": "dist/main.js",
10
10
  "types": "dist/main.d.ts",
@@ -51,11 +51,11 @@
51
51
  },
52
52
  "homepage": "https://github.com/abofs/stonyx-sockets#readme",
53
53
  "dependencies": {
54
- "stonyx": "0.2.3-beta.62",
54
+ "stonyx": "0.2.3-beta.78",
55
55
  "ws": "^8.18.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@stonyx/utils": "0.2.3-beta.23",
58
+ "@stonyx/utils": "0.2.3-beta.26",
59
59
  "@types/node": "^25.5.2",
60
60
  "@types/ws": "^8.18.1",
61
61
  "qunit": "^2.24.1",