traforo 0.0.4 → 0.0.6

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 CHANGED
@@ -30,7 +30,7 @@ Run a command and tunnel it:
30
30
 
31
31
  The tunnel URL will be:
32
32
 
33
- https://{tunnel-id}-tunnel.kimaki.xyz
33
+ https://{tunnel-id}-tunnel.traforo.dev
34
34
 
35
35
 
36
36
  OPTIONS
package/dist/client.d.ts CHANGED
@@ -6,7 +6,9 @@ type TunnelClientOptions = {
6
6
  localPort: number;
7
7
  /** Local host (default: localhost) */
8
8
  localHost?: string;
9
- /** Tunnel server URL (default: wss://{tunnelId}-tunnel.kimaki.xyz) */
9
+ /** Base domain for tunnel URLs (default: kimaki.xyz) */
10
+ baseDomain?: string;
11
+ /** Tunnel server URL (default: wss://{tunnelId}-tunnel.{baseDomain}) */
10
12
  serverUrl?: string;
11
13
  /** Tunnel ID */
12
14
  tunnelId: string;
package/dist/client.js CHANGED
@@ -8,9 +8,11 @@ export class TunnelClient {
8
8
  localWsConnections = new Map();
9
9
  closed = false;
10
10
  constructor(options) {
11
+ const baseDomain = options.baseDomain || 'traforo.dev';
11
12
  this.options = {
12
13
  localHost: 'localhost',
13
- serverUrl: `wss://${options.tunnelId}-tunnel.kimaki.xyz`,
14
+ baseDomain,
15
+ serverUrl: `wss://${options.tunnelId}-tunnel.${baseDomain}`,
14
16
  localHttps: false,
15
17
  autoReconnect: true,
16
18
  reconnectDelay: 3000,
@@ -18,7 +20,7 @@ export class TunnelClient {
18
20
  };
19
21
  }
20
22
  get url() {
21
- return `https://${this.options.tunnelId}-tunnel.kimaki.xyz`;
23
+ return `https://${this.options.tunnelId}-tunnel.${this.options.baseDomain}`;
22
24
  }
23
25
  async connect() {
24
26
  if (this.closed) {
@@ -3,6 +3,7 @@ export type RunTunnelOptions = {
3
3
  port: number;
4
4
  tunnelId?: string;
5
5
  localHost?: string;
6
+ baseDomain?: string;
6
7
  serverUrl?: string;
7
8
  command?: string[];
8
9
  };
@@ -93,6 +93,7 @@ export async function runTunnel(options) {
93
93
  localPort: port,
94
94
  tunnelId,
95
95
  localHost,
96
+ ...(options.baseDomain && { baseDomain: options.baseDomain }),
96
97
  ...(options.serverUrl && { serverUrl: options.serverUrl }),
97
98
  });
98
99
  // Handle shutdown
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "traforo",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "HTTP tunnel via Cloudflare Durable Objects and WebSockets",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "repository": "https://github.com/remorses/kimaki",
7
+ "repository": "https://github.com/remorses/traforo",
8
8
  "engines": {
9
9
  "node": ">=18.0.0"
10
10
  },