@kadi.build/file-sharing 1.1.1 → 1.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kadi.build/file-sharing",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "File sharing service with tunneling and local S3-compatible interface",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -365,7 +365,13 @@ export class FileSharingServer extends EventEmitter {
365
365
  }
366
366
 
367
367
  const service = options.service || 'kadi'; // KĀDI is the default
368
- const port = this.config.port;
368
+
369
+ // Allow caller to specify which port to tunnel via options.port.
370
+ // Default: when S3 is running, target the S3 port (where custom routes
371
+ // and middleware are installed via addCustomRoute/addMiddleware).
372
+ // Otherwise fall back to the HTTP file-server port.
373
+ const port = options.port
374
+ ?? (this.s3Server?.isRunning ? this.s3Server.config.port : this.config.port);
369
375
 
370
376
  // TunnelManager.createTunnel(port, options) — port is first arg (number),
371
377
  // options.service tells it which provider to use.