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 +1 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +4 -2
- package/dist/run-tunnel.d.ts +1 -0
- package/dist/run-tunnel.js +1 -0
- package/package.json +2 -2
package/README
CHANGED
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
|
-
/**
|
|
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
|
-
|
|
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.
|
|
23
|
+
return `https://${this.options.tunnelId}-tunnel.${this.options.baseDomain}`;
|
|
22
24
|
}
|
|
23
25
|
async connect() {
|
|
24
26
|
if (this.closed) {
|
package/dist/run-tunnel.d.ts
CHANGED
package/dist/run-tunnel.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "traforo",
|
|
3
|
-
"version": "0.0.
|
|
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/
|
|
7
|
+
"repository": "https://github.com/remorses/traforo",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=18.0.0"
|
|
10
10
|
},
|