@nora-link/client 1.0.10 → 1.0.11

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 CHANGED
@@ -32,4 +32,10 @@ You can acess the tunnel by navigating to [https://noralink.eu/home](https://nor
32
32
 
33
33
  Currently only a subset of subdomains are available to use with your own tunnels, from the following: *admin, api, app, control, dashboard, home, my, nodered, smarthome, test*.
34
34
 
35
- If you want a new subdomain, add a request here: [Request a new subdomain thread](https://github.com/andrei-tatar/nora-link-client/issues/1).
35
+ If you want a new subdomain, add a request here: [Request a new subdomain thread](https://github.com/andrei-tatar/nora-link-client/issues/1).
36
+
37
+ ## Pricing
38
+
39
+ This service is currently free to use, but as our cloud costs grow, we plan to charge for use to cover the costs. This
40
+ means that while basic features will remain free, full access and advanced features will require a subscription. We
41
+ appreciate your understanding and support as we continue to improve our service.
package/dist/cli.js CHANGED
@@ -11,6 +11,7 @@ commander_1.program
11
11
  .usage('[OPTIONS]...')
12
12
  .option('-d, --debug', 'output extra debugging', false)
13
13
  .option('-n, --non-secure', 'don\'t use secure connection', false)
14
+ .option('-h, --host <hostname>', 'Server host name')
14
15
  .option('-l, --log <log-level>', `min log level to display. Options: ${logger_1.LOG_LEVEL.join(',')}`, (value, previous) => {
15
16
  const v = value?.toLowerCase();
16
17
  if (logger_1.LOG_LEVEL.includes(v)) {
@@ -20,7 +21,6 @@ commander_1.program
20
21
  }, 'info')
21
22
  .requiredOption('-f, --forward <subdomain|label|url...>', 'Tunnel subdomain to local url. Label is optional')
22
23
  .requiredOption('-k, --key <api-key>', 'Api Key')
23
- .requiredOption('-h, --host <hostname>', 'Server host name', 'noralink.eu')
24
24
  .addHelpText('afterAll', 'To tunnel a local port to the subdomain `test`, you can use `-f "test|localhost:3000"`')
25
25
  .addHelpText('afterAll', 'To tunnel an ip to the subdomain `test`, you can use `-f "test|192.168.1.130"`')
26
26
  .addHelpText('afterAll', 'To tunnel a local hostname to the subdomain `test` with label `My App`, you can use `-f "test|My App|local-host.local"`')
package/dist/client.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Observable } from 'rxjs';
2
- import WebSocket from 'ws';
3
2
  import { Logger } from './logger';
4
3
  export interface TunnelOptions {
5
4
  remotePath: string;
@@ -9,7 +8,7 @@ export interface TunnelOptions {
9
8
  }
10
9
  export interface ClientConnectionOptions {
11
10
  agent?: string;
12
- hostname: string;
11
+ hostname?: string;
13
12
  secure?: boolean;
14
13
  apiKey: string;
15
14
  tunnels: TunnelOptions[];
@@ -20,8 +19,8 @@ export declare class Client {
20
19
  constructor(options: ClientConnectionOptions);
21
20
  private server$;
22
21
  private data$;
23
- readonly handle$: Observable<void | WebSocket>;
24
- send(id: number, type: string, msg?: Buffer): Observable<void>;
22
+ readonly handle$: Observable<'connected' | 'connecting'>;
23
+ private send;
25
24
  private getStreamData;
26
25
  private httpRequest;
27
26
  }
package/dist/client.js CHANGED
@@ -23,7 +23,8 @@ class Client {
23
23
  'user-agent': this.options.agent,
24
24
  } : {}),
25
25
  };
26
- const ws = new ws_1.default(`${protocol}://${this.options.hostname}/api/tunnel?${qs}`, { headers });
26
+ const hostname = this.options.hostname ?? 'noralink.eu';
27
+ const ws = new ws_1.default(`${protocol}://${hostname}/api/tunnel?${qs}`, { headers });
27
28
  ws.on('open', () => {
28
29
  this.options.logger?.info(`[nora-link] connected`);
29
30
  observer.next(ws);
@@ -62,7 +63,7 @@ class Client {
62
63
  data$: this.getStreamData(id),
63
64
  send: (type, msg) => this.send(id, type, msg),
64
65
  })
65
- : rxjs_1.EMPTY))).pipe((0, rxjs_1.retry)({
66
+ : rxjs_1.EMPTY))).pipe((0, rxjs_1.startWith)('connecting'), (0, rxjs_1.map)(_ => 'connected'), (0, rxjs_1.retry)({
66
67
  resetOnSuccess: true,
67
68
  delay: (err, retryCount) => {
68
69
  const delaySeconds = Math.round(Math.min(600, Math.pow(1.8, retryCount - 1)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nora-link/client",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "noralink.eu client",
5
5
  "bin": {
6
6
  "noralink": "dist/cli.js"