iosignal-cli 1.1.1 → 1.3.1
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 +222 -56
- package/auth_file.json +13 -0
- package/auth_file.mjs +23 -0
- package/bin/io-client.js +3 -3
- package/bin/io-server.js +3 -4
- package/bin/serverInfo.js +33 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# IOSignal CLI
|
|
2
2
|
|
|
3
|
+
iosignal supports real-time communication between web browsers, node.js, and arduino. It also provides secure authentication and encrypted communication. The signaling protocol is built-in, so the server can be used without programming.
|
|
4
|
+
|
|
3
5
|
iosignal-cli program that makes it simple to run a iosignal server and client. It uses the [iosignal](https://www.npmjs.com/package/iosignal) library and uses Redis for authentication database functionality.
|
|
4
6
|
|
|
7
|
+
[Kr] iosignal 은 웹브라우저, node.js , arduino 간의 실시간 통신을 지원합니다. 또한 보안 인증과 암호통신 기능도 제공됩니다. 시그널링 프로토콜이 내장되어 있어서 서버는 프로그래밍 없이 사용 가능합니다.
|
|
8
|
+
|
|
5
9
|
## supports
|
|
10
|
+
|
|
6
11
|
Windows, Mac, and Linux.
|
|
7
12
|
|
|
8
13
|
## install
|
|
14
|
+
|
|
9
15
|
Linux, Mac and shell
|
|
16
|
+
|
|
10
17
|
```sh
|
|
11
18
|
# global install.
|
|
12
19
|
$ npm install -g iosignal-cli
|
|
13
20
|
|
|
14
|
-
# If
|
|
21
|
+
# If you encounter a permissions error, use sudo.
|
|
15
22
|
$ sudo npm install -g iosignal-cli
|
|
16
23
|
```
|
|
17
24
|
windows as admin permission
|
|
@@ -20,75 +27,238 @@ windows as admin permission
|
|
|
20
27
|
$ npm install -g iosignal-cli
|
|
21
28
|
```
|
|
22
29
|
|
|
23
|
-
|
|
24
30
|
## IOSignal server
|
|
25
31
|
|
|
32
|
+
- use `io-server` command.
|
|
33
|
+
- `ios` is a shortened name for io-server.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
% io-server -h
|
|
37
|
+
Usage: io-server [options] (--listen <port> )
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
-V, --version output the version number
|
|
41
|
+
-l, --listen <port> listen on port (start WebSocket Server)
|
|
42
|
+
-L, --listen-congport <port> listen on cong port (start CongSocket
|
|
43
|
+
Server)
|
|
44
|
+
-d, --auth-file <path> auth data file path
|
|
45
|
+
-e, --auth-param <id.key.level> auth data from argument:
|
|
46
|
+
id.key.level,id2.key2.level2
|
|
47
|
+
-E, --auth-env auth data from shell env BOHO_AUTH
|
|
48
|
+
-r, --auth-redis connect to redis. if exist use env
|
|
49
|
+
REDIS_HOST, REDIS_PORT or localhost:6379
|
|
50
|
+
-t, --timeout <milliseconds> ping period & timeout
|
|
51
|
+
-m, --metric <type> show metric <number> 1:traffic, 2:echo
|
|
52
|
+
-s, --show-message <none|message> show receive message.
|
|
53
|
+
-f, --file-logger write log files.
|
|
54
|
+
-a, --api-list [list...] one or multiple api names: -a api_1 api_2
|
|
55
|
+
-o, --show-options show server init options.
|
|
56
|
+
-h, --help display help for command
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### IOSignal over WebSocket
|
|
61
|
+
|
|
62
|
+
- Use the -l option to specify the port number for websocket connections.
|
|
63
|
+
|
|
64
|
+
- Supports web browser and node.js client access.
|
|
65
|
+
|
|
26
66
|
```sh
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
67
|
+
% io-server -l 7777
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### IOSignal Over CongSocket
|
|
30
71
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- Local: ws://localhost:7777
|
|
36
|
-
- Network: ws://192.168.0.204:7777
|
|
37
|
-
|
|
38
|
-
└─────────────────────────────────────────┘
|
|
72
|
+
- Use the -L option to specify the port number for CongSocket connections.
|
|
73
|
+
- CongSocket is IOSignal's own protocol that is lighter than WebSocket.
|
|
74
|
+
- It was developed specifically for low-end devices like Arduino.
|
|
75
|
+
- Supports Arduino and node.js client access.
|
|
39
76
|
|
|
77
|
+
```sh
|
|
78
|
+
% io-server -L 8888
|
|
79
|
+
```
|
|
40
80
|
|
|
41
|
-
|
|
42
|
-
|
|
81
|
+
### WebSocket and CongSocket can be supported together.
|
|
82
|
+
|
|
83
|
+
- This allows the Arduino and web browser to communicate with each other.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
% io-server -l 7777 -L 8888
|
|
88
|
+
opening WebSocket Server: 7777
|
|
89
|
+
opening CongSocket Server: 8888
|
|
43
90
|
|
|
44
91
|
┌───────────────────────────────────────────┐
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
92
|
+
│ │
|
|
93
|
+
│ Serving │
|
|
94
|
+
│ │
|
|
95
|
+
│ IOSignal Over WebSocket │
|
|
96
|
+
│ │
|
|
97
|
+
│ Web Browser & Node.js │
|
|
98
|
+
│ - Local: ws://localhost:7777 │
|
|
99
|
+
│ - Network: ws://192.168.0.72:7777 │
|
|
100
|
+
│ │
|
|
101
|
+
│ IOSignal Over CongSocket │
|
|
102
|
+
│ │
|
|
103
|
+
│ Node.js │
|
|
104
|
+
│ - Local: cong://localhost:8888 │
|
|
105
|
+
│ - Network: cong://192.168.0.72:8888 │
|
|
106
|
+
│ │
|
|
107
|
+
│ Arduino │
|
|
108
|
+
│ - host: 192.168.0.72 │
|
|
109
|
+
│ - port: 8888 │
|
|
110
|
+
│ │
|
|
61
111
|
└───────────────────────────────────────────┘
|
|
62
112
|
|
|
63
113
|
|
|
64
114
|
|
|
65
|
-
|
|
66
|
-
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Monitor Server
|
|
118
|
+
|
|
119
|
+
### Viewing incoming messages
|
|
120
|
+
|
|
121
|
+
- To view server incoming signal messages, use the -s option.
|
|
122
|
+
- `ios` is a shortened name for `io-server`.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
% ios -l 7777 -s message
|
|
126
|
+
...
|
|
127
|
+
|
|
128
|
+
#1(undefined) [ CID_REQ ] <Buffer c1>
|
|
129
|
+
#1(?ayTp) [ SIGNAL ] <Buffer d0 02 68 69 00>
|
|
130
|
+
#1(?ayTp) [ PING ] <Buffer cd>
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Viewing metrics
|
|
135
|
+
|
|
136
|
+
- `-m 1` : channels, clients, traffic
|
|
137
|
+
- `-m 2` : clients
|
|
138
|
+
- `-m 3` : channels
|
|
139
|
+
|
|
140
|
+
```sh
|
|
67
141
|
|
|
142
|
+
$ ios -l 7777 -m 1
|
|
143
|
+
...
|
|
144
|
+
|
|
145
|
+
monitor metric type: 1
|
|
146
|
+
┌─────────┬───────────┬───────────┬──────────┬──────────┬──────────────┐
|
|
147
|
+
│ (index) │ rss │ heapTotal │ heapUsed │ external │ arrayBuffers │
|
|
148
|
+
├─────────┼───────────┼───────────┼──────────┼──────────┼──────────────┤
|
|
149
|
+
│ 0 │ 108232704 │ 57294848 │ 24523112 │ 1389925 │ 59260 │
|
|
150
|
+
└─────────┴───────────┴───────────┴──────────┴──────────┴──────────────┘
|
|
151
|
+
┌─────────┬──────────┬─────────┬──────────┬─────────┬─────────┐
|
|
152
|
+
│ (index) │ lastSSID │ remotes │ channels │ txBytes │ rxBytes │
|
|
153
|
+
├─────────┼──────────┼─────────┼──────────┼─────────┼─────────┤
|
|
154
|
+
│ 0 │ 2 │ 2 │ 1 │ 57 │ 18 │
|
|
155
|
+
└─────────┴──────────┴─────────┴──────────┴─────────┴─────────┘
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
$ ios -l 7777 -m 2
|
|
159
|
+
...
|
|
160
|
+
monitor metric type: 2
|
|
161
|
+
┌─────────┬───────────────┐
|
|
162
|
+
│ (index) │ Values │
|
|
163
|
+
├─────────┼───────────────┤
|
|
164
|
+
│ 0 │ '#1:?9P-i(7)' │
|
|
165
|
+
│ 1 │ '#2:?zNuW(7)' │
|
|
166
|
+
└─────────┴───────────────┘
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
$ ios -l 7777 -m 3
|
|
170
|
+
...
|
|
171
|
+
monitor metric type: 3
|
|
172
|
+
┌─────────┬───────────────────────┐
|
|
173
|
+
│ (index) │ Values │
|
|
174
|
+
├─────────┼───────────────────────┤
|
|
175
|
+
│ 0 │ 'PRIVATE:#homeButton' │
|
|
176
|
+
└─────────┴───────────────────────┘
|
|
68
177
|
```
|
|
69
178
|
|
|
70
179
|
## iosignal client
|
|
71
180
|
|
|
181
|
+
- use `io-client` command.
|
|
182
|
+
- `io` is a shortened name for io-client.
|
|
183
|
+
|
|
184
|
+
### usage
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
% io -h
|
|
188
|
+
Usage: io [options] (--connect <url> )
|
|
189
|
+
|
|
190
|
+
Options:
|
|
191
|
+
-V, --version output the version number
|
|
192
|
+
-t, --timeout <milliseconds> ping period & timeout
|
|
193
|
+
-c, --connect <url> connect to a server
|
|
194
|
+
-i, --id <id> userId
|
|
195
|
+
-k, --key <key> userKey
|
|
196
|
+
-a, --auth-idKey <idkey> auth id.key
|
|
197
|
+
-j, --join-channel <channelName> join to channel
|
|
198
|
+
-h, --help display help for command
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### connection
|
|
203
|
+
- To connect to a server, specify the server address and port number with the -c option.
|
|
204
|
+
|
|
205
|
+
- The server address specifies one of the following protocols: ws, wss, or cong.
|
|
206
|
+
- `ws`://url:port (WebSocket)
|
|
207
|
+
- In the case of localhost, ws can be omitted.
|
|
208
|
+
- `wss`://url:port (WebSocket TLS)
|
|
209
|
+
- `cong`://url:port ( CongSocket)
|
|
72
210
|
|
|
73
211
|
```sh
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
212
|
+
% io -c ws://localhost:7777
|
|
213
|
+
{ connect: 'ws://localhost:7777' }
|
|
214
|
+
Connecting to ws://localhost:7777
|
|
215
|
+
ready: cid: ?cybL
|
|
216
|
+
>
|
|
77
217
|
|
|
78
|
-
|
|
79
|
-
$ io -c wss://websocket_server_url:port
|
|
80
|
-
$ io -c ws://localhost:7777
|
|
218
|
+
```
|
|
81
219
|
|
|
82
|
-
|
|
220
|
+
```sh
|
|
221
|
+
% io -c cong://localhost:8888
|
|
222
|
+
{ connect: 'cong://localhost:8888' }
|
|
223
|
+
Connecting to cong://localhost:8888
|
|
224
|
+
ready: cid: ?yVAQ
|
|
225
|
+
>
|
|
83
226
|
|
|
84
227
|
```
|
|
85
228
|
|
|
86
|
-
|
|
229
|
+
- On successful client connection, the `cid` is displayed with a `ready` indication.
|
|
230
|
+
- The CID is a unique communication ID issued by the server.
|
|
231
|
+
- The CID of an unauthenticated client changes with each connection.
|
|
232
|
+
- Authenticated clients use a fixed, predefined CID.
|
|
233
|
+
- You can use CIDs for one-to-one communication or CID subscriptions.
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### io-client cli command list
|
|
237
|
+
|
|
238
|
+
- When connected to the server with the io-client CLI program, you can communicate, subscribe, and issue signals with the commands below.
|
|
239
|
+
- The CLI program can also communicate with browsers and Arduino connected to the server.
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
io-client cli commands:
|
|
243
|
+
.sig
|
|
244
|
+
.signal .publish .pub is the same as .sig.
|
|
245
|
+
.sub
|
|
246
|
+
.subscribe is the same as .sub.
|
|
247
|
+
.listen : subscirbe and print the received messages to the screen.
|
|
248
|
+
.unsub
|
|
249
|
+
.ping
|
|
250
|
+
.pong
|
|
251
|
+
.id
|
|
252
|
+
.iam
|
|
253
|
+
.open
|
|
254
|
+
.connect
|
|
255
|
+
.close
|
|
256
|
+
.login
|
|
257
|
+
.auth
|
|
258
|
+
.quit
|
|
259
|
+
.exit
|
|
260
|
+
```
|
|
87
261
|
|
|
88
|
-
- subscribe('tag')
|
|
89
|
-
- publish('tag', message )
|
|
90
|
-
- signal('tag', message ) // same with publish
|
|
91
|
-
- not ready whole document.
|
|
92
262
|
|
|
93
263
|
## tutorial
|
|
94
264
|
|
|
@@ -99,18 +269,16 @@ $ io -c ws://localhost:7777
|
|
|
99
269
|
|
|
100
270
|
1. start server
|
|
101
271
|
```sh
|
|
102
|
-
$ io-server
|
|
272
|
+
$ io-server -l 7777
|
|
103
273
|
|
|
104
274
|
```
|
|
105
275
|
|
|
106
276
|
2. start client A.
|
|
107
277
|
|
|
108
278
|
```sh
|
|
109
|
-
$ io
|
|
279
|
+
$ io -c localhost:7777
|
|
110
280
|
Connecting to ws://localhost:7777
|
|
111
281
|
ready: cid: ?c3Nr
|
|
112
|
-
# connected and receive client cid.
|
|
113
|
-
# CID(Communicaion Id of the io client.)
|
|
114
282
|
|
|
115
283
|
> .subscribe channel_name
|
|
116
284
|
# subscribe some channel
|
|
@@ -118,12 +286,10 @@ ready: cid: ?c3Nr
|
|
|
118
286
|
|
|
119
287
|
3. start client B.
|
|
120
288
|
```sh
|
|
121
|
-
$ io
|
|
289
|
+
$ io -c localhost:7777
|
|
122
290
|
Connecting to ws://localhost:7777
|
|
123
291
|
ready: cid: ?rr75
|
|
124
292
|
>
|
|
125
|
-
# connected and received cid.
|
|
126
|
-
|
|
127
293
|
# multicast.
|
|
128
294
|
> .signal channel_name some_message
|
|
129
295
|
|
|
@@ -142,9 +308,9 @@ ready: cid: ?rr75
|
|
|
142
308
|
- each device have 4 values: `deviceId`, `deviceKey`, `deviceCId`, `level`
|
|
143
309
|
- you can find sample auth_file.mjs and auth_file.json in root folder.
|
|
144
310
|
```sh
|
|
145
|
-
$ io-server -d auth_file.json
|
|
311
|
+
$ io-server -l 7777 -d auth_file.json
|
|
146
312
|
or
|
|
147
|
-
$ io-server -d auth_file.mjs
|
|
313
|
+
$ io-server -l 7777 -d auth_file.mjs
|
|
148
314
|
```
|
|
149
315
|
|
|
150
316
|
auth_file.json structure
|
|
@@ -186,7 +352,7 @@ Before running the server, you need to make sure that your Redis server is up an
|
|
|
186
352
|
|
|
187
353
|
start server with local redis-auth-system
|
|
188
354
|
```sh
|
|
189
|
-
$ io-server -r
|
|
355
|
+
$ io-server -l 7777 -r # redis://localhost:6379
|
|
190
356
|
```
|
|
191
357
|
|
|
192
358
|
|
|
@@ -195,7 +361,7 @@ $ io-server -r // redis://localhost:6379
|
|
|
195
361
|
2. connect and login
|
|
196
362
|
|
|
197
363
|
```sh
|
|
198
|
-
$ io
|
|
364
|
+
$ io -c localhost:7777
|
|
199
365
|
ready: cid: ?YXDr
|
|
200
366
|
> .login uno3 uno3-key
|
|
201
367
|
try manual login: uno3
|
package/auth_file.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[
|
|
2
|
+
["sampleid","samplekey","sample_cid",0],
|
|
3
|
+
["id_max8","no_key_size_limit","communication_id",0],
|
|
4
|
+
["device1","device1_key","device1_cid",0],
|
|
5
|
+
["device2","device2_key","device2_cid",0],
|
|
6
|
+
["uno","uno","uno",1],
|
|
7
|
+
["go","go","go",2],
|
|
8
|
+
["bro","bro","bro",3],
|
|
9
|
+
["admin","admin","admin",255],
|
|
10
|
+
["adminb","adminb","adminb",255]
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
|
package/auth_file.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
Authentication data sample.
|
|
4
|
+
|
|
5
|
+
device props: ["did", "key", "cid", level ]
|
|
6
|
+
|
|
7
|
+
did: ( device id ) authentication id. maximum 8 chars.
|
|
8
|
+
key: ( device key ) authentication key. no size limit.
|
|
9
|
+
cid: ( communication id ) signal target id. maximum 12 chars.
|
|
10
|
+
level:( quota level) <Number> ref. /server/quotaTable.js
|
|
11
|
+
|
|
12
|
+
*/
|
|
13
|
+
export const authInfo = [
|
|
14
|
+
["did","passowrd","cid",0],
|
|
15
|
+
["device1","device1_key","device1_cid",0],
|
|
16
|
+
["device2","device2_key","device2_cid",0],
|
|
17
|
+
["uno","uno-key","uno",1],
|
|
18
|
+
["go","go-key","go",2],
|
|
19
|
+
["bro","bro-key","bro",3],
|
|
20
|
+
["admin","admin-key","admin",255],
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
|
package/bin/io-client.js
CHANGED
|
@@ -95,7 +95,6 @@ program
|
|
|
95
95
|
.version(version)
|
|
96
96
|
.usage('[options] (--connect <url> )')
|
|
97
97
|
.option('-t, --timeout <milliseconds>', 'ping period & timeout')
|
|
98
|
-
.option('-s, --show-message <none|message|frame>', 'show receive message. ')
|
|
99
98
|
.option('-c, --connect <url>', 'connect to a server')
|
|
100
99
|
.option('-i, --id <id>', 'userId')
|
|
101
100
|
.option('-k, --key <key>', 'userKey')
|
|
@@ -104,12 +103,12 @@ program
|
|
|
104
103
|
.parse(process.argv)
|
|
105
104
|
|
|
106
105
|
const options = program.opts()
|
|
106
|
+
const defaultWebSocketPort = 7777;
|
|
107
107
|
|
|
108
108
|
console.log(options)
|
|
109
109
|
|
|
110
|
-
|
|
111
110
|
if (!options.connect) {
|
|
112
|
-
options.connect = 'localhost:' +
|
|
111
|
+
options.connect = 'localhost:' + defaultWebSocketPort;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
|
|
@@ -389,6 +388,7 @@ wsConsole.on('line', (data) => {
|
|
|
389
388
|
)
|
|
390
389
|
}
|
|
391
390
|
} else {
|
|
391
|
+
io.send( data )
|
|
392
392
|
}
|
|
393
393
|
wsConsole.prompt()
|
|
394
394
|
})
|
package/bin/io-server.js
CHANGED
|
@@ -22,7 +22,7 @@ program
|
|
|
22
22
|
.option('-r, --auth-redis', 'connect to redis. if exist use env REDIS_HOST, REDIS_PORT or localhost:6379')
|
|
23
23
|
.option('-t, --timeout <milliseconds>', 'ping period & timeout')
|
|
24
24
|
.option('-m, --metric <type>', 'show metric <number> 1:traffic, 2:echo')
|
|
25
|
-
.option('-s, --show-message <none|message
|
|
25
|
+
.option('-s, --show-message <none|message>', 'show receive message. ')
|
|
26
26
|
.option('-f, --file-logger', 'write log files.')
|
|
27
27
|
.option('-a, --api-list [list...]', 'one or multiple api names: -a api_1 api_2 ')
|
|
28
28
|
.option('-o, --show-options', 'show server init options.')
|
|
@@ -30,7 +30,6 @@ program
|
|
|
30
30
|
|
|
31
31
|
const options = program.opts()
|
|
32
32
|
|
|
33
|
-
|
|
34
33
|
if (options.fileLogger) {
|
|
35
34
|
serverOption.fileLogger.connection.use = true;
|
|
36
35
|
serverOption.fileLogger.auth.use = true;
|
|
@@ -38,7 +37,7 @@ if (options.fileLogger) {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
if (options.listen) {
|
|
41
|
-
serverOption.port = options.listen
|
|
40
|
+
serverOption.port = parseInt(options.listen)
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
if (options.listenCongport) {
|
|
@@ -77,7 +76,7 @@ if (options.authFile) {
|
|
|
77
76
|
redisClient.connect();
|
|
78
77
|
authManager = new Auth_Redis(redisClient)
|
|
79
78
|
} else {
|
|
80
|
-
console.log("No authentication support.")
|
|
79
|
+
// console.log("No authentication support.")
|
|
81
80
|
|
|
82
81
|
}
|
|
83
82
|
|
package/bin/serverInfo.js
CHANGED
|
@@ -18,25 +18,48 @@ function getNetworkAddress (){
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
export function serverInfo ( wsPort, congPort ){
|
|
21
|
+
// console.log('wsPort', wsPort, 'congPort', congPort)
|
|
21
22
|
let ip = getNetworkAddress();
|
|
22
|
-
let message
|
|
23
|
+
let message
|
|
24
|
+
|
|
25
|
+
if( wsPort || congPort ){
|
|
26
|
+
message = chalk.green('Serving');
|
|
27
|
+
}else{
|
|
28
|
+
message = chalk.green('please use -l and -L option to select port number.');
|
|
29
|
+
message += chalk.yellow('\n\n $ io-server -l 7777');
|
|
30
|
+
message += chalk.green(' // iosignal over websocket.');
|
|
31
|
+
message += chalk.yellow('\n\n $ io-server -L 8888');
|
|
32
|
+
message += chalk.green(' // iosignal over congsocket.');
|
|
33
|
+
message += chalk.yellow('\n\n $ io-server -l 7777 -L 8888');
|
|
34
|
+
message += chalk.green(' // suppport both.');
|
|
35
|
+
message += chalk.yellow('\n\n $ io-server -h');
|
|
36
|
+
message += chalk.green(' // display help');
|
|
37
|
+
}
|
|
23
38
|
|
|
24
39
|
const prefix = '- '
|
|
25
40
|
const space = ' '
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
if(wsPort){
|
|
43
|
+
message += `\n\n`;
|
|
44
|
+
message += chalk.green('IOSignal Over WebSocket');
|
|
45
|
+
message += chalk.yellow('\n\n Web Browser & Node.js');
|
|
46
|
+
message += `\n ${chalk.bold(`${prefix}Local:`)}${space}ws://localhost:${wsPort}`;
|
|
47
|
+
message += `\n ${chalk.bold('- Network:')} ws://${ip}:${wsPort}`;
|
|
48
|
+
}else{
|
|
49
|
+
|
|
50
|
+
}
|
|
29
51
|
|
|
30
52
|
if(congPort){
|
|
31
53
|
message += `\n\n`;
|
|
32
|
-
message += chalk.green('
|
|
33
|
-
message +=
|
|
34
|
-
message += `\n${chalk.bold('- Network:')} cong://${ip}:${congPort}`;
|
|
54
|
+
message += chalk.green('IOSignal Over CongSocket');
|
|
55
|
+
message += chalk.yellow('\n\n Node.js');
|
|
35
56
|
|
|
36
|
-
message += `\n
|
|
37
|
-
message += chalk.
|
|
38
|
-
|
|
39
|
-
message +=
|
|
57
|
+
message += `\n ${chalk.bold(`${prefix}Local:`)}${space}cong://localhost:${congPort}`;
|
|
58
|
+
message += `\n ${chalk.bold('- Network:')} cong://${ip}:${congPort}`;
|
|
59
|
+
|
|
60
|
+
message += chalk.yellow('\n\n Arduino');
|
|
61
|
+
message += `\n ${chalk.bold(`${prefix}host:`)} ${ip}`;
|
|
62
|
+
message += `\n ${chalk.bold('- port:')} ${congPort }`;
|
|
40
63
|
|
|
41
64
|
}
|
|
42
65
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iosignal-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "IOSignal server and client CLI program.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"boxen": "^7.1.1",
|
|
20
20
|
"chalk": "^5.3.0",
|
|
21
21
|
"commander": "^11.1.0",
|
|
22
|
-
"iosignal": "^1.
|
|
22
|
+
"iosignal": "^1.3.1",
|
|
23
23
|
"meta-buffer-pack": "^1.3.1",
|
|
24
24
|
"redis": "^4.6.12"
|
|
25
25
|
},
|