unismsgateway 1.4.0 → 1.5.0

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
@@ -306,7 +306,7 @@ const gateway = unisms.init({
306
306
  | `protocol` | `'https'` |
307
307
 
308
308
 
309
- Requests use `POST` to path `**/v5/<endpoint>`** (e.g. send: `message/sms/send`, balance: `account/balance`). Authorization header: `Authorization: key <apiKey>`.
309
+ Requests use `POST` to path `**/v5/<endpoint>`** (e.g. send: `message/sms/send`, balance: `account/balance`). Authorization header: `Authorization: key <apiKey>`. Each request opens a fresh connection (keep-alive pooling is disabled) to prevent stale-socket errors in long-running processes.
310
310
 
311
311
  ```javascript
312
312
  const gateway = unisms.init({
@@ -456,6 +456,13 @@ Full variable reference (selection, per-gateway credentials, live send): [Live i
456
456
  | `getGateway()` | `ISmsGateway` | Underlying adapter (for nest: `getBalance()`). |
457
457
 
458
458
 
459
+ ---
460
+
461
+ ## Changelog
462
+
463
+ ### 1.5.0
464
+ - **Fix (`nest`):** `quickSend` now reliably works in long-running processes (servers, workers). Node's global HTTP agent reuses keep-alive sockets across calls; when the provider closes an idle socket server-side, the next `quickSend` that writes a request body received `write ECONNABORTED` while `getBalance` (no body) appeared to work fine. Fixed by setting `agent: false` on each request so every call opens a fresh connection rather than reusing a potentially stale one from the pool.
465
+
459
466
  ---
460
467
 
461
468
  ## License
@@ -67,6 +67,11 @@ class NestSmsGateway {
67
67
  port,
68
68
  path: `/v5/${endpoint}`,
69
69
  method: 'POST',
70
+ // Disable keep-alive connection pooling. Node's global agent reuses
71
+ // sockets across calls; when the server closes an idle socket server-side
72
+ // the next write (i.e. the request body in quickSend) gets ECONNABORTED.
73
+ // agent:false forces a fresh connection for every request.
74
+ agent: false,
70
75
  headers: {
71
76
  'Host': hostname,
72
77
  'Content-Type': 'application/json',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unismsgateway",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "A unified SMS gateway library that brings access to multiple SMS gateways under a single API",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",