@nora-link/client 1.0.12 → 1.0.14

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/dist/cli.js CHANGED
File without changes
package/dist/client.js CHANGED
@@ -16,7 +16,7 @@ class Client {
16
16
  const subdomains = this.options.tunnels.map(v => `${v.subdomain}|${v.label}`);
17
17
  const qs = (0, node_querystring_1.stringify)({ s: subdomains });
18
18
  this.options.logger?.info(`[nora-link] connecting`);
19
- const protocol = this.options.secure ? 'wss' : 'ws';
19
+ const protocol = (this.options.secure ?? true) ? 'wss' : 'ws';
20
20
  const headers = {
21
21
  authorization: `Bearer ${this.options.apiKey}`,
22
22
  ...(this.options.agent ? {
@@ -24,12 +24,17 @@ class Client {
24
24
  } : {}),
25
25
  };
26
26
  const hostname = this.options.hostname ?? 'noralink.eu';
27
- const ws = new ws_1.default(`${protocol}://${hostname}/api/tunnel?${qs}`, { headers });
27
+ const ws = new ws_1.default(`${protocol}://${hostname}/api/tunnel?${qs}`, {
28
+ headers,
29
+ followRedirects: true,
30
+ });
28
31
  ws.on('open', () => {
29
32
  this.options.logger?.info(`[nora-link] connected`);
30
33
  observer.next(ws);
31
34
  });
32
- ws.on('error', err => observer.error(err));
35
+ ws.on('error', (err) => {
36
+ observer.error(err);
37
+ });
33
38
  ws.on('close', () => observer.complete());
34
39
  return () => ws.close();
35
40
  }).pipe((0, rxjs_1.share)({ connector: () => new rxjs_1.ReplaySubject(1) }));
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@nora-link/client",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "noralink.eu client",
5
5
  "bin": {
6
6
  "noralink": "dist/cli.js"
7
7
  },
8
8
  "main": "dist/index.js",
9
9
  "scripts": {
10
+ "clean": "rm -rf dist",
10
11
  "build": "tsc",
11
- "pub": "npm run build && npm publish --access=public --registry https://registry.npmjs.org/"
12
+ "pub": "npm run clean && npm run build && npm publish --access=public --registry https://registry.npmjs.org/"
12
13
  },
13
14
  "repository": {
14
15
  "type": "git",