You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Global Input App(GIA) WebSocket server, responsible for routing encrypted messages between device applications, and is one of the constituent parts of [the GIA mobile integration solution](https://globalinput.co.uk/). The [Global Input App(GIA)](https://globalinput.co.uk/) with its extensions provides a universal mobile integration solution for web and device applications, allowing users to use mobiles to operate on those applications, and provides the following functionalities:
This is a WebSocket server responsible for relaying encrypted messages between devices. Being as part of the Mobile Integration Platform powered by [Global Input App](https://globalinput.co.uk/), which secures data using end-to-end encryption at the device-to-device level, it can run on an unsecured infrastructure.
9
3
10
4
### Download
11
-
Download the Node.JS application and its dependencies :
@@ -17,53 +11,20 @@ Download the Node.JS application and its dependencies :
17
11
```
18
12
19
13
### Modify the Configuration
20
-
Open the configuration file [/app/config/config.json](https://github.com/global-input/global-input-node/blob/master/app/config/config.json), locate the url attribute:
14
+
The configuration file [/app/config/config.json](https://github.com/global-input/global-input-node/blob/master/app/config/config.json) contains the information to inform the devices how to connect to the WebSocket server:
21
15
```
22
16
....
23
17
"name":"default",
24
18
"apikey":"k7jc3QcMPKEXGW5UC",
25
19
"url":"https://node3.globalinput.co.uk"
26
20
...
27
21
```
28
-
and modify its value to point to your own GIA WebSocket server instance. The URL is going to be used by both the application running on your device and the Global Input App running on your mobile, to connect to your WebSocket server instance. Hence, the URL should be reachable from the network that your devices are connected to. For example, if you use a URL with an internal network address, the device and your mobile should be connected to the same network.
22
+
The value of the ```apikey``` parameter is used to control which device applications can use the resource represented by the Web Socket server, and it does not have any data security implication. You can modify the value of the ```url``` parameter to reflect the infrastructure that is set up to run your WebSocket server. The ```url``` should be reachable to both the device application and the mobile app (Global Input App) in order to communicate with each other.
29
23
30
-
### Run the WebSock server
31
-
run the Node application:
32
-
```
33
-
nodejs server.js
34
-
```
35
-
This repository also contains the scripts for building the docker images for [the WebSocket Server Container](https://cloud.docker.com/u/dilshat/repository/docker/dilshat/global_input_node) and [the Nginx Reverse Proxy Container](https://cloud.docker.com/repository/docker/dilshat/global_input_nginx) .
36
-
37
-
### Configuring the GIA Extensions
38
-
39
-
The details of the communication between the WebSocket server are encapsulated within the GIA extensions so that applications can just provide mobile user interfaces and callbacks to process mobile events. The GIA extensions are:
A GIA extension library connects to a GIA WebSocket server and displays an Encrypted QR Code to tell GIA how to connect to it. The URL of the WebSocket server and the APIKey value required connecting to the WebSocket server
47
-
are contained in the Encrypted QR Code contains
48
-
If you are using [the GIA Chrome Extension](https://github.com/global-input/chrome-extension), click on ```Communication Settings``` in the extension window. You can modify the WebSocket URL and the API key values that are used by the GIA Chrome extension to connect to the WebSocket server.
49
-
50
-
If you are using the [GIA React Extension]([https://github.com/global-input/global-input-react](https://github.com/global-input/global-input-react)) or [the GIA JS Extension](https://github.com/global-input/global-input-message), you can set the URL and APIKey value of your WebSocket server in the mobile config:
51
26
```
52
-
let mobileConfig={
53
-
url:<url to your websocket server>,
54
-
apikey:<apikey required for connection>,
55
-
initData:{
56
-
form:{
57
-
...
58
-
}
59
-
60
-
}
27
+
nodejs server.js
61
28
```
29
+
Alternative, you can build a docker image, or download and run from [docker hub](https://cloud.docker.com/u/dilshat/repository/docker/dilshat/global_input_node). You may place a [the Nginx load balancer](https://cloud.docker.com/repository/docker/dilshat/global_input_nginx) in front to manage multiple instances.
62
30
63
-
64
-
### GIA WebSocket Load Balancing Strategy
65
-
66
-
Websockets are persistent contrary to those on the RestAPI calls. This means that a large number of connections needs to be kept open simultaneously. Although the workloads of processes are distributed across the nodes, the long-running WebSocket connections themselves will be increasing burden on the load balancer itself.
67
-
68
-
In the GIA WebSocket Loadbalancing Strategy, in order to resolve this limitation, every WebSocket session is started with an initial RestAPI call on the LoadBalancer to obtain the URL of a WebSocket Server node, so that the application will connect to the WebSocket node directly without going through the load balancer. The sequence of actions in the process for starting a WebSocket connection is shown in the following diagram:
69
-

0 commit comments