iosignal 9.19.0 → 9.21.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.ko.md +16 -2
- package/README.md +25 -2
- package/dist/browser/esm/io.d.ts +14 -0
- package/dist/browser/esm/io.js +4 -4
- package/dist/browser/esm/io.js.map +1 -1
- package/dist/browser/iife/io.js +4 -4
- package/dist/browser/iife/io.js.map +1 -1
- package/dist/node/iosignal.cjs +263 -46
- package/dist/node/iosignal.d.cts +44 -5
- package/dist/node/iosignal.d.ts +44 -5
- package/dist/node/iosignal.js +263 -47
- package/dist/types/client/IOCore.d.ts +14 -0
- package/dist/types/common/constants.d.ts +8 -0
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -196,7 +196,7 @@ new Server({ port: 7777, localAuth: 'idKey' }) //
|
|
|
196
196
|
new Server({ port: 7777, localAuth: { mode: 'sharedKey', key: 'lab2026' } }) // io.auth('dev1', 'lab2026')
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
익명
|
|
199
|
+
익명 연결이 시그널을 보내거나 구독하지 못하게 하려면 `membersOnly: true`를 함께 지정합니다(시도하면 연결이 닫힙니다).
|
|
200
200
|
[로컬 테스트 로그인](https://github.com/remocons/iosignal/blob/main/docs/boho.ko.md#로컬-테스트-로그인-localauth)을 참고하세요.
|
|
201
201
|
|
|
202
202
|
## 역할과 쿼터
|
|
@@ -210,7 +210,8 @@ new Server({ port: 7777, localAuth: { mode: 'sharedKey', key: 'lab2026' } }) //
|
|
|
210
210
|
`RedisService(client, minRole)`의 기본값은 `service`입니다.
|
|
211
211
|
- 쿼터 프로필은 `quotas` 서버 옵션에 이름으로 정의한 제한 묶음입니다.
|
|
212
212
|
`maxMessageBytes`, `fanout`(발행 한 건이 전달되는 구독자 수), `msgPerSec`, `bytesPerSec`,
|
|
213
|
-
계정별 `maxConnections
|
|
213
|
+
계정별 `maxConnections`, 연결 하나가 구독할 수 있는 태그 수 `maxSubscriptions`를 지정하며
|
|
214
|
+
`null`은 무제한입니다. 서버가 항상 적용합니다.
|
|
214
215
|
미로그인 연결은 `anonymousQuota`를, 로그인은 키 항목의 quota 또는
|
|
215
216
|
`BohoAuth`의 `resolveQuota(authInfo, role)` 옵션 결과를 사용합니다.
|
|
216
217
|
- 내장 프로필(`serverOption.quotas`의 `anonymous`, `basic`, `pro`, `unlimited`)은 운영자가
|
|
@@ -245,6 +246,19 @@ const server = new Server({
|
|
|
245
246
|
- 쿼터는 새 `QUOTA` 메시지로 전달됩니다. 이전 클라이언트는 이를 무시하고 기존
|
|
246
247
|
로컬 크기 제한을 유지합니다.
|
|
247
248
|
|
|
249
|
+
## 9.21 변경 사항
|
|
250
|
+
|
|
251
|
+
- `membersOnly`는 익명 연결이 구독할 때도 연결을 닫습니다(이전에는 시그널을 보낼 때만).
|
|
252
|
+
- 쿼터 `maxSubscriptions`: 넘는 태그는 구독되지 않습니다(`SUBSCRIBE_REQ`는 255로 응답).
|
|
253
|
+
- 틀린 로그인: 한 연결에서 5번이면 연결을 닫고, 공인 주소 하나에서 1분에 30번이면 1분이 지날 때까지
|
|
254
|
+
그 주소의 로그인을 확인하지 않고 닫습니다(`serverOption.auth`). 키 저장소를 읽지 못하면 `AUTH_FAIL` 대신
|
|
255
|
+
연결을 닫아 클라이언트가 다시 로그인합니다.
|
|
256
|
+
- 키 제공자는 8바이트를 넘는 로그인 ID를 등록할 때 거부합니다(이전에는 8바이트로 잘려 일치하지 않았습니다).
|
|
257
|
+
- `security.requireEncryption`(기본 꺼짐): TLS가 아닌 로그인 연결은 시그널·구독·호출을 평문으로 보낼 수 없습니다.
|
|
258
|
+
- 클라이언트: 서버에서 40초 동안 받은 것이 없으면 PING을 보내고, 15초 안에 아무것도 오지 않으면 연결을 닫고 다시 접속합니다.
|
|
259
|
+
재접속은 최대 1초 뒤 처음 시도하고, `ready`에 이르지 못하는 동안 3·6·12·24·30초 간격으로 늘립니다(이전에는 항상 3초).
|
|
260
|
+
- 클라이언트: `close`, `ready`, `error`, `change` 같은 클라이언트 자체 이벤트 이름의 채널 시그널은 `message`로만 전달됩니다.
|
|
261
|
+
|
|
248
262
|
## 상세 문서
|
|
249
263
|
|
|
250
264
|
- [시그널 태그와 직접 메시지](https://github.com/remocons/iosignal/blob/main/docs/messaging.ko.md)
|
package/README.md
CHANGED
|
@@ -202,7 +202,8 @@ new Server({ port: 7777, localAuth: 'idKey' }) //
|
|
|
202
202
|
new Server({ port: 7777, localAuth: { mode: 'sharedKey', key: 'lab2026' } }) // io.auth('dev1', 'lab2026')
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
Add `membersOnly: true` to
|
|
205
|
+
Add `membersOnly: true` to close anonymous connections that send a signal or
|
|
206
|
+
subscribe. See
|
|
206
207
|
[Local test logins](https://github.com/remocons/iosignal/blob/main/docs/boho.md#local-test-logins-localauth).
|
|
207
208
|
|
|
208
209
|
## Roles and quotas
|
|
@@ -217,7 +218,8 @@ how much it may send. They are independent.
|
|
|
217
218
|
`admin`, `RedisService(client, minRole)` defaults to `service`.
|
|
218
219
|
- Quota profiles are named sets of limits in the `quotas` server option:
|
|
219
220
|
`maxMessageBytes`, `fanout` (subscribers one publish reaches), `msgPerSec`,
|
|
220
|
-
`bytesPerSec
|
|
221
|
+
`bytesPerSec`, `maxConnections` per account and `maxSubscriptions` (tags one
|
|
222
|
+
connection may be subscribed to). `null` means unlimited.
|
|
221
223
|
The server always enforces them. Unauthenticated connections use
|
|
222
224
|
`anonymousQuota`; a login uses its key entry's quota, or the result of the
|
|
223
225
|
`BohoAuth` `resolveQuota(authInfo, role)` option.
|
|
@@ -258,6 +260,27 @@ replacement.
|
|
|
258
260
|
- The quota is sent in a new `QUOTA` message; older clients ignore it and
|
|
259
261
|
keep their previous local size limit.
|
|
260
262
|
|
|
263
|
+
## Changes in 9.21
|
|
264
|
+
|
|
265
|
+
- `membersOnly` also closes an anonymous connection that subscribes (before,
|
|
266
|
+
only one that sent a signal).
|
|
267
|
+
- Quota `maxSubscriptions`: tags over it are not subscribed
|
|
268
|
+
(`SUBSCRIBE_REQ` answers 255).
|
|
269
|
+
- Wrong logins: a connection is closed after 5; a public address with 30 in a
|
|
270
|
+
minute has its next logins closed without a check until the minute has
|
|
271
|
+
passed (`serverOption.auth`). A key store that cannot be read closes the
|
|
272
|
+
connection instead of answering `AUTH_FAIL`, so the client logs in again.
|
|
273
|
+
- Key providers refuse a login ID longer than 8 bytes when it is added (it was
|
|
274
|
+
cut to 8 bytes and could not match).
|
|
275
|
+
- `security.requireEncryption` (off by default): a logged-in connection without
|
|
276
|
+
TLS may not send plain signals, subscriptions or calls.
|
|
277
|
+
- Client: after 40 s without anything from the server it sends a PING, and
|
|
278
|
+
closes the connection when nothing arrives within 15 s (then reconnects).
|
|
279
|
+
Reconnect attempts start after up to 1 s and, while none reaches `ready`,
|
|
280
|
+
wait 3, 6, 12, 24 and then 30 s instead of always 3 s.
|
|
281
|
+
- Client: a signal on a channel named like one of the client's own events
|
|
282
|
+
(`close`, `ready`, `error`, `change`, ...) is emitted as `message` only.
|
|
283
|
+
|
|
261
284
|
## Detailed guides
|
|
262
285
|
|
|
263
286
|
- [Signal tags and direct messages](https://github.com/remocons/iosignal/blob/main/docs/messaging.md)
|
package/dist/browser/esm/io.d.ts
CHANGED
|
@@ -69,6 +69,16 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
69
69
|
* @type {number}
|
|
70
70
|
*/
|
|
71
71
|
lastTxRxTime: number;
|
|
72
|
+
/**
|
|
73
|
+
* Last time anything was received from the server (see keepAlive()).
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
lastRxTime: number;
|
|
77
|
+
/** @private Time of a PING that has had no answer yet; 0 when none is pending. */
|
|
78
|
+
private _pingSentAt;
|
|
79
|
+
/** @private Connections closed since the last ready, and the earliest time of the next automatic attempt. */
|
|
80
|
+
private _reconnectAttempts;
|
|
81
|
+
_nextConnectAt: number;
|
|
72
82
|
/**
|
|
73
83
|
* Period for connection checker.
|
|
74
84
|
* @type {number}
|
|
@@ -188,6 +198,10 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
188
198
|
* is implemented keepConnection() in the child classes (IOWS, IOCongSocket, etc.).
|
|
189
199
|
*/
|
|
190
200
|
keepAlive(): void;
|
|
201
|
+
/** @private When keepAlive() may connect again after this close: see SIZE_LIMIT.RECONNECT_*. */
|
|
202
|
+
private scheduleReconnect;
|
|
203
|
+
/** @private True from the socket opening until it closes (any state a server message can arrive in). */
|
|
204
|
+
private isLinkUp;
|
|
191
205
|
/**
|
|
192
206
|
* Redirects the connection to a new URL.
|
|
193
207
|
* @param {string} url2 - The new URL to redirect to.
|