iosignal-cli 3.2.0 → 4.0.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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # IOSignal CLI
2
- [ 한국어 | [English](README.md) ]
2
+ [ 한국어 | [English](./README.md) ]
3
3
 
4
4
  IOSignal은 웹 브라우저, Node.js 애플리케이션 및 Arduino 장치 간의 실시간 통신을 용이하게 합니다. 또한 안전한 인증 및 암호화된 통신을 제공합니다. 내장된 시그널링 프로토콜을 통해 서버는 추가 프로그래밍 없이 사용할 수 있습니다.
5
5
 
@@ -130,50 +130,6 @@ opening CongSocket Server: 8888
130
130
 
131
131
  ```
132
132
 
133
- ### 메트릭 보기
134
-
135
- - `-m 1`: 채널, 클라이언트 및 트래픽을 표시합니다.
136
- - `-m 2`: 클라이언트를 표시합니다.
137
- - `-m 3`: 채널을 표시합니다.
138
-
139
- ```sh
140
-
141
- $ ios -l 7777 -m 1
142
- ...
143
-
144
- monitor metric type: 1
145
- ┌─────────┬───────────┬───────────┬──────────┬──────────┬──────────────┐
146
- │ (index) │ rss │ heapTotal │ heapUsed │ external │ arrayBuffers │
147
- ├─────────┼───────────┼───────────┼──────────┼──────────┼──────────────┤
148
- │ 0 │ 108232704 │ 57294848 │ 24523112 │ 1389925 │ 59260 │
149
- └─────────┴───────────┴───────────┴──────────┴──────────┴──────────────┘
150
- ┌─────────┬──────────┬─────────┬──────────┬─────────┬─────────┐
151
- │ (index) │ lastSSID │ remotes │ channels │ txBytes │ rxBytes │
152
- ├─────────┼──────────┼─────────┼──────────┼─────────┼─────────┤
153
- │ 0 │ 2 │ 2 │ 1 │ 57 │ 18 │
154
- └─────────┴──────────┴─────────┴──────────┴─────────┴─────────┘
155
-
156
-
157
- $ ios -l 7777 -m 2
158
- ...
159
- monitor metric type: 2
160
- ┌─────────┬───────────────┐
161
- │ (index) │ Values │
162
- ├─────────┼───────────────┤
163
- │ 0 │ '#1:?9P-i(7)' │
164
- │ 1 │ '#2:?zNuW(7)' │
165
- └─────────┴───────────────┘
166
-
167
-
168
- $ ios -l 7777 -m 3
169
- ...
170
- monitor metric type: 3
171
- ┌─────────┬───────────────────────┐
172
- │ (index) │ Values │
173
- ├─────────┼───────────────────────┤
174
- │ 0 │ 'PRIVATE:#homeButton' │
175
- └─────────┴───────────────────────┘
176
- ```
177
133
 
178
134
  ## IOSignal 클라이언트
179
135
 
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # IOSignal CLI
2
- [ [한국어](README.ko.md) | English ]
2
+ [ [한국어](./README.ko.md) | English ]
3
3
 
4
4
  IOSignal facilitates real-time communication among web browsers, Node.js applications, and Arduino devices. It also offers secure authentication and encrypted communication. With its built-in signaling protocol, the server can be used without additional programming.
5
5
 
@@ -132,50 +132,6 @@ opening CongSocket Server: 8888
132
132
 
133
133
  ```
134
134
 
135
- ### Viewing Metrics
136
-
137
- - `-m 1`: Displays channels, clients, and traffic.
138
- - `-m 2`: Displays clients.
139
- - `-m 3`: Displays channels.
140
-
141
- ```sh
142
-
143
- $ ios -l 7777 -m 1
144
- ...
145
-
146
- monitor metric type: 1
147
- ┌─────────┬───────────┬───────────┬──────────┬──────────┬──────────────┐
148
- │ (index) │ rss │ heapTotal │ heapUsed │ external │ arrayBuffers │
149
- ├─────────┼───────────┼───────────┼──────────┼──────────┼──────────────┤
150
- │ 0 │ 108232704 │ 57294848 │ 24523112 │ 1389925 │ 59260 │
151
- └─────────┴───────────┴───────────┴──────────┴──────────┴──────────────┘
152
- ┌─────────┬──────────┬─────────┬──────────┬─────────┬─────────┐
153
- │ (index) │ lastSSID │ remotes │ channels │ txBytes │ rxBytes │
154
- ├─────────┼──────────┼─────────┼──────────┼─────────┼─────────┤
155
- │ 0 │ 2 │ 2 │ 1 │ 57 │ 18 │
156
- └─────────┴──────────┴─────────┴──────────┴─────────┴─────────┘
157
-
158
-
159
- $ ios -l 7777 -m 2
160
- ...
161
- monitor metric type: 2
162
- ┌─────────┬───────────────┐
163
- │ (index) │ Values │
164
- ├─────────┼───────────────┤
165
- │ 0 │ '#1:?9P-i(7)' │
166
- │ 1 │ '#2:?zNuW(7)' │
167
- └─────────┴───────────────┘
168
-
169
-
170
- $ ios -l 7777 -m 3
171
- ...
172
- monitor metric type: 3
173
- ┌─────────┬───────────────────────┐
174
- │ (index) │ Values │
175
- ├─────────┼───────────────────────┤
176
- │ 0 │ 'PRIVATE:#homeButton' │
177
- └─────────┴───────────────────────┘
178
- ```
179
135
 
180
136
  ## IOSignal Client
181
137
 
package/bin/io-client.js CHANGED
@@ -137,10 +137,12 @@ if (options.id && options.key) {
137
137
  }
138
138
 
139
139
 
140
- io.listen('@', (...args) => {
141
- console.log('rcv @', args)
140
+ io.listen('@', (tag, ...args) => {
141
+ console.log('CID Message: ', tag, args)
142
142
  })
143
143
 
144
+
145
+
144
146
  if (options.joinChannel) {
145
147
  console.log('options joinchannel', options.joinChannel)
146
148
  io.channels.add(options.joinChannel)
@@ -189,29 +191,24 @@ io.on('over_size', () => {
189
191
  Console.Colors.Yellow)
190
192
  })
191
193
 
194
+ io.on('echo', (...args) => {
195
+ wsConsole.print(
196
+ Console.Types.Control,
197
+ `ECHO ${args}`,
198
+ Console.Colors.Yellow)
199
+ })
200
+ io.on('iam_res', (...args) => {
201
+ // console.log('log: ', args)
202
+ wsConsole.print(
203
+ Console.Types.Incoming,
204
+ `IAM_RES ${args}`,
205
+ Console.Colors.Yellow)
206
+ })
192
207
 
193
- io.on('message', (data, isBinary) => {
194
-
195
- let moreBytesIndicator = ""
196
- if (isBinary) {
197
- let buffer
198
- const displayBufferLimit = 20
199
- if (data.byteLength > displayBufferLimit) {
200
- buffer = Buffer.from(data, 0, displayBufferLimit);
201
- moreBytesIndicator = "..."
202
- } else {
203
- buffer = Buffer.from(data);
204
- }
205
-
206
- let prn = `${buffer.toString('hex')}${moreBytesIndicator} [${data.byteLength} bytes total]`;
207
- if (wsConsole.showIncommingMessage) wsConsole.print(Console.Types.Incoming, `rx: bin [hex] ${prn}`, Console.Colors.Green)
208
-
209
- } else {
210
- if (wsConsole.showIncommingMessage) wsConsole.print(Console.Types.Incoming, `rx: text: ${data}`, Console.Colors.Green)
211
- }
208
+ io.on('message',(tag,...args)=>{
209
+ wsConsole.print(Console.Types.Incoming, `message: ${tag} ${args}`, Console.Colors.Green)
212
210
  })
213
211
 
214
- // to send frame message.
215
212
  wsConsole.on('line', (data) => {
216
213
  if (data[0] === '.') {
217
214
  const toks = data.split(/\s+/)
@@ -331,12 +328,13 @@ wsConsole.on('line', (data) => {
331
328
  case 'listen':
332
329
  toks.shift()
333
330
  let tag = toks[0]
334
- console.log('listen tag', tag)
335
- io.listen(tag, (...args) => {
336
- console.log(`subscribe & listen tag: ${tag} args:`, args)
331
+ io.subscribe( tag )
332
+ console.log('subscribe tag', tag)
333
+ // io.listen(tag, (tag, ...args) => {
334
+ // console.log(`subscribe & listen tag: ${tag} args:`, args)
337
335
 
338
- })
339
- io.subscribe_memory_channels()
336
+ // })
337
+ // io.subscribe_memory_channels()
340
338
  break;
341
339
 
342
340
 
@@ -388,7 +386,12 @@ wsConsole.on('line', (data) => {
388
386
  )
389
387
  }
390
388
  } else {
391
- io.send( data )
389
+ // io.send( data )
390
+ wsConsole.print(
391
+ Console.Types.Error,
392
+ 'command list: .signal .sig .listen .publish .pub .subscribe .sub .unsub .ping .pong .id .iam .open .connect .close .login .auth .quit .exit',
393
+ Console.Colors.Yellow
394
+ )
392
395
  }
393
396
  wsConsole.prompt()
394
397
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iosignal-cli",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
4
4
  "description": "IOSignal server and client CLI program.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  "boxen": "8.0.1",
22
22
  "chalk": "5.6.2",
23
23
  "commander": "13.1.0",
24
- "iosignal": "^3.2.0",
24
+ "iosignal": "^4.0.0",
25
25
  "redis": "4.7.1"
26
26
  },
27
27
  "repository": {