hsync 0.10.0 → 0.12.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/cli.js +14 -4
- package/config.js +2 -0
- package/connection.js +1 -0
- package/dist/hsync.js +383 -0
- package/dist/hsync.min.js +2 -0
- package/dist/hsync.min.js.LICENSE.txt +10 -0
- package/hsync-web.js +5 -1
- package/package.json +6 -3
- package/webpack.config.js +19 -0
package/cli.js
CHANGED
|
@@ -12,22 +12,32 @@ program
|
|
|
12
12
|
.addOption(new Option('-p, --port <number>', 'port for local webserver', 3000).env('PORT'))
|
|
13
13
|
.addOption(new Option('-d, --dynamic-host <url>', 'host to get a dynamic connection from').env('HSYNC_DYNAMIC_HOST'))
|
|
14
14
|
.addOption(new Option('-s, --hsync-server <url>', 'hsync-server location ex: wss://sub.mydomain.com').env('HSYNC_SERVER'))
|
|
15
|
-
.addOption(new Option('-
|
|
15
|
+
.addOption(new Option('-hs, --hsync-secret <url>', 'password to connect to hsync-server').env('HSYNC_SECRET'));
|
|
16
16
|
|
|
17
17
|
program.parse();
|
|
18
18
|
|
|
19
19
|
const options = program.opts();
|
|
20
20
|
|
|
21
|
-
console.log(options);
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
if(options.port) {
|
|
23
|
+
options.port = Number(options.port);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let [defaultCon] = config.connections;
|
|
27
|
+
defaultCon = {...defaultCon, ...options};
|
|
28
|
+
|
|
24
29
|
if (!defaultCon.hsyncServer && !defaultCon.dynamicHost) {
|
|
25
30
|
defaultCon.dynamicHost = config.defaultDynamicHost;
|
|
26
31
|
}
|
|
27
32
|
|
|
33
|
+
config.connections[0] = defaultCon;
|
|
34
|
+
|
|
28
35
|
config.connections.forEach(async (conConfig) => {
|
|
29
36
|
const con = await createConnection(conConfig);
|
|
37
|
+
console.log();
|
|
30
38
|
console.log('Listening for requests on: ', con.webUrl);
|
|
39
|
+
console.log('And forwarding to: ', 'http://localhost:' + con.port);
|
|
40
|
+
console.log();
|
|
41
|
+
console.log('Admin ui at: ', con.webAdmin);
|
|
31
42
|
console.log('Secret: ', con.hsyncSecret);
|
|
32
|
-
console.log('Admin instance at: ', con.webAdmin);
|
|
33
43
|
});
|
package/config.js
CHANGED
package/connection.js
CHANGED