traforo 0.0.5 → 0.0.7

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
@@ -39,8 +39,7 @@ OPTIONS
39
39
  -p, --port <port> Local port to expose (required)
40
40
  -t, --tunnel-id [id] Tunnel ID (random if omitted)
41
41
  -h, --host [host] Local host (default: localhost)
42
- -d, --domain [domain] Base domain (default: traforo.dev)
43
- -s, --server [url] Custom tunnel server URL (overrides domain)
42
+ -s, --server [url] Custom tunnel server URL
44
43
  --help Show help
45
44
  --version Show version
46
45
 
package/dist/cli.js CHANGED
@@ -8,13 +8,11 @@ cli
8
8
  .option('-p, --port <port>', 'Local port to expose (required)')
9
9
  .option('-t, --tunnel-id [id]', 'Tunnel ID (random if omitted)')
10
10
  .option('-h, --host [host]', 'Local host (default: localhost)')
11
- .option('-d, --domain [domain]', 'Base domain (default: kimaki.xyz)')
12
- .option('-s, --server [url]', 'Tunnel server URL (overrides domain)')
11
+ .option('-s, --server [url]', 'Tunnel server URL')
13
12
  .example(`${CLI_NAME} -p 3000`)
14
13
  .example(`${CLI_NAME} -p 3000 -- next start`)
15
14
  .example(`${CLI_NAME} -p 3000 -- pnpm dev`)
16
15
  .example(`${CLI_NAME} -p 5173 -t my-app -- vite`)
17
- .example(`${CLI_NAME} -p 3000 -d traforo.dev -- pnpm dev`)
18
16
  .action(async (options) => {
19
17
  if (!options.port) {
20
18
  console.error('Error: --port is required');
@@ -30,7 +28,6 @@ cli
30
28
  port,
31
29
  tunnelId: options.tunnelId,
32
30
  localHost: options.host,
33
- baseDomain: options.domain,
34
31
  serverUrl: options.server,
35
32
  command: command.length > 0 ? command : undefined,
36
33
  });
package/dist/client.js CHANGED
@@ -117,11 +117,18 @@ export class TunnelClient {
117
117
  headers: msg.headers,
118
118
  body: msg.method !== 'GET' && msg.method !== 'HEAD' ? body : undefined,
119
119
  });
120
- // Build response headers
120
+ // Build response headers, preserving multi-value Set-Cookie
121
121
  const resHeaders = {};
122
122
  res.headers.forEach((value, key) => {
123
+ if (key === 'set-cookie') {
124
+ return;
125
+ }
123
126
  resHeaders[key] = value;
124
127
  });
128
+ const cookies = res.headers.getSetCookie();
129
+ if (cookies.length > 0) {
130
+ resHeaders['set-cookie'] = cookies.length === 1 ? cookies[0] : cookies;
131
+ }
125
132
  // Check if we should stream the response
126
133
  const contentType = res.headers.get('content-type') || '';
127
134
  const transferEncoding = res.headers.get('transfer-encoding') || '';
package/dist/types.d.ts CHANGED
@@ -25,18 +25,19 @@ export type WsCloseMessage = {
25
25
  reason: string;
26
26
  };
27
27
  export type UpstreamMessage = HttpRequestMessage | WsOpenMessage | WsFrameMessage | WsCloseMessage;
28
+ export type ResponseHeaders = Record<string, string | string[]>;
28
29
  export type HttpResponseMessage = {
29
30
  type: 'http_response';
30
31
  id: string;
31
32
  status: number;
32
- headers: Record<string, string>;
33
+ headers: ResponseHeaders;
33
34
  body: string | null;
34
35
  };
35
36
  export type HttpResponseStartMessage = {
36
37
  type: 'http_response_start';
37
38
  id: string;
38
39
  status: number;
39
- headers: Record<string, string>;
40
+ headers: ResponseHeaders;
40
41
  };
41
42
  export type HttpResponseChunkMessage = {
42
43
  type: 'http_response_chunk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traforo",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "HTTP tunnel via Cloudflare Durable Objects and WebSockets",
5
5
  "type": "module",
6
6
  "license": "MIT",