Skip to content

Commit e7ecfea

Browse files
authored
Update README.md to reality
1 parent f4697e1 commit e7ecfea

File tree

1 file changed

+49
-36
lines changed

1 file changed

+49
-36
lines changed

README.md

+49-36
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ Client for WebSocket Servers and to collect the replies in IRIS.
99

1010
I used node-v10.15.1-x64.msi and intersystems-iris-native package
1111

12-
### How it works
12+
## How it works
1313
You provide a Global for input in namespace USER (default)
1414

15-
set ^ZSockIn(0)=6
16-
set ^ZSockIn(1)="Hello"
17-
set ^ZSockIn(2)="World !"
18-
set ^ZSockIn(3)="Robert"
19-
set ^ZSockIn(4)="is waiting"
20-
set ^ZSockIn(5)="for replies"
21-
set ^ZSockIn(6)="exit"
15+
set ^ZSocketIn(0)=6
16+
set ^ZSocketIn(1)="Hello"
17+
set ^ZSocketIn(2)="World !"
18+
set ^ZSocketIn(3)="Robert"
19+
set ^ZSocketIn(4)="is waiting"
20+
set ^ZSocketIn(5)="for replies"
21+
set ^ZSocketIn(6)="exit"
2222

2323
The server is controlled by ^ZSocketRun from IRIS
2424

@@ -29,53 +29,66 @@ set ^ZSocketRun=1 ; => send to echo server
2929

3030
and from echo server you get back a Global as output
3131
written by Node.js using the Native API for Node.js
32-
33-
zwrite ^ZSockOut
32+
```
33+
zwrite ^ZSocketOut
3434
^ZSocketOut="wss://ws.postman-echo.com/"
35-
^ZZSockOut(0)=6
36-
^ZSockOut(1)="Hello"
37-
^ZSockOut(2)="World !"
38-
^ZSockOut(3)="Robert"
39-
^ZSockOut(4)="is waiting"
40-
^ZSockOut(5)="for replies"
41-
^ZSockOut(6)="exit"
42-
35+
^ZSocketOut(0)=6
36+
^ZSocketOut(1)="Hello"
37+
^ZSocketOut(2)="World !"
38+
^ZSocketOut(3)="Robert"
39+
^ZSocketOut(4)="is waiting"
40+
^ZSocketOut(5)="for replies"
41+
^ZSocketOut(6)="exit"
42+
```
43+
Or run
44+
```
45+
USER>do ^ZSocket
46+
```
4347
### Local installation and operation
4448
The WebSocket Service is started from OS command line.
4549
You can follow the progress in console output
46-
47-
*C:\Program Files\nodejs\cache>node WebSocketIRIS.js*
48-
50+
```
51+
C:\Program Files\nodejs\cache>node WebSocketIRIS.js <server-ip>:<superserver-port>
52+
```
4953
![image](https://github.com/rcemper/WebSocketIRIS.js/assets/31236645/7791b075-4474-4649-bb3b-de7db1f7fff0)
5054

5155
[Comment in DC](https://community.intersystems.com/post/client-websockets-based-nodejs#comment-128726)
5256

5357
## Docker support
5458
### Prerequisites
5559
Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker desktop](https://www.docker.com/products/docker-desktop) installed.
56-
5760
### Installation
5861
Clone/git pull the repo into any local directory
59-
````
62+
```
6063
git clone https://github.com/rcemper/WebSocketIRIS.js.git
61-
````
62-
64+
```
6365
Open the terminal in this directory, build and run the container:
64-
65-
````
66+
```
6667
docker-compose up -d
67-
````
68+
```
6869
Next open a IRIS session in namespace USER and prepare the Globals for testing
6970
a test program **ZSocket.MAC** is in subdirectory **src** of download directory
7071

71-
![image](https://github.com/rcemper/WebSocketIRIS.js/assets/31236645/87032767-8b47-442b-8a19-84ed8b0e0fa2)
72-
7372
Now activate your Node.js client
7473
Have the external IP address and the SuperServerPort ready !
7574
default: localhost:1972 is just a placeholder
76-
77-
*docker-compose exec wsock nodejs WebSocketIRIS.js <ip-adr>:<port>*
78-
79-
![image](https://github.com/rcemper/WebSocketIRIS.js/assets/31236645/97836bfb-dc65-4352-b47c-37753a8f53f4)
80-
81-
75+
```
76+
docker-compose exec wsock nodejs WebSocketIRIS.js <ip-adr>:<port>
77+
```
78+
From IRIS terminal run
79+
```
80+
USER>do ^ZSocket
81+
82+
*** Welcome to WebSocket Micoservice demo ***
83+
Known Hosts (*=Exit) [1]:
84+
1 wss://ws.postman-echo.com/raw
85+
2 --- server 2 ----
86+
3 --- server 3 ----
87+
select (1): 1 ==> wss://ws.postman-echo.com/raw
88+
#
89+
Enter text to get echoed from WebSocketClient Service
90+
Terminate with * at first position
91+
or get generated text by %
92+
or append new text with @
93+
```
94+

0 commit comments

Comments
 (0)