Dev.to Security ๐Ÿ” Cybersecurity ๐Ÿ‘ 0 ๐Ÿ“– 10 min read

Share a Local Folder Over HTTPS Without Deploying

Sharing a folder of static files, build artifacts, or downloadable assets from your workstation usually turns into an unnecessary deployment chore. Pushing a quick prototype to object storage, configuring a bucket policy

Sharing a folder of static files, build artifacts, or downloadable assets from your workstation usually turns into an unnecessary deployment chore. Pushing a quick prototype to object storage, configuring a bucket policy, spinning up a temporary staging server, or compressing gigabytes of media into a third-party file transfer service wastes minutes when all you need is a clean HTTPS link pointing directly to a local directory.

With InstaWormhole, you can expose a local directory over HTTPS directly from your machine without uploading files to a staging server or provisioning cloud storage. Depending on whether you want a browser-based sharing workflow or a persistent, CLI-driven local server setup, InstaWormhole provides two distinct paths documented in the InstaWormhole documentation: Browser Quick Share and the CLI Connector (@instawormhole/connector).

This guide walks through how to share a local folder of files over HTTPS, how to choose between the connector and Browser Quick Share, how to serve static directories cleanly with standard local tooling, and what to check before exposing local directories to external recipients.

Why Share a Local Directory Directly Over HTTPS

Modern frontend builds, design handoffs, dataset previews, and static documentation bundles often live on your local filesystem long before they belong in a production repository. Traditional workarounds introduce friction at every step:

  • Cloud staging deployments require build pipelines, hosting credentials, and manual cleanup afterward so stale previews do not linger online.
  • Third-party file upload portals force you to archive folders into .zip files, wait for uploads to complete, and re-upload every time you tweak a single asset.
  • Raw local servers without TLS fail when recipients open links on external networks, test browser APIs that require secure contexts (https://), or inspect previews behind strict corporate firewalls that block non-standard ports.

Exposing a local folder over HTTPS solves all three issues simultaneously. Recipients receive a public https:// URL that serves files straight from your local directory. When you update a file on disk, refreshing the browser reflects the change immediatelyโ€”and when you close the session, the tunnel stops accepting traffic.

Choose Between the Connector and Browser Quick Share

InstaWormhole offers two ways to share local files and folders over HTTPS, as covered in the InstaWormhole documentation. Choosing the right method depends on whether you want zero-install browser convenience or terminal-based automation and multi-tunnel control.

Comparison Factor Browser Quick Share InstaWormhole Connector (@instawormhole/connector)
Setup & Installation Zero CLI setup; runs directly in your browser from the dashboard Runs via npx @instawormhole/connector in your terminal
Best Use Case Ad-hoc file or folder sharing with colleagues, designers, or clients Developer workflows, local HTTP servers, custom configs, and automation
Authentication Uses your active browser session in the InstaWormhole dashboard Uses device login (login) or --stored-device credentials
Configuration Interactive browser UI selection CLI flags or instawormhole.toml configuration file
Lifecycle Active while the browser session remains open Active while the CLI process runs in your terminal
Multi-Tunnel Support Single browser sharing session Supports multiple simultaneous tunnels via instawormhole.toml

When to Use Browser Quick Share

Use Browser Quick Share when you want the fastest path from a folder on your desktop to an HTTPS link without touching a terminal. It is ideal when:

  • You are sharing design exports, PDFs, screenshots, or compiled static bundles with non-technical stakeholders.
  • You are working on a machine where you do not want to install or run Node.js CLI commands.
  • You need a one-off link for a quick review during a call and plan to close the session immediately afterward.

When to Use the InstaWormhole Connector

Use the InstaWormhole Connector when folder sharing is part of an active development workflow. It is the better choice when:

  • You are already serving a local folder through a local development server or static file server on localhost (such as Vite, serve, or Python's built-in http.server module).
  • You want reproducible, scriptable tunnel setups defined in instawormhole.toml.
  • You need to expose a static frontend directory alongside a local backend API from a single configuration file.
  • You want to inspect incoming HTTP requests, replay traffic, or manage access controls from the dashboard while testing.

Method 1: Share a Folder Using Browser Quick Share

Browser Quick Share lets you select a local folder directly inside the InstaWormhole web interface and generate a public HTTPS URL without running a separate local web server or CLI tool. Under the hood, modern browsers expose local directory reads through the File System Access API and directory input selectors, allowing your browser tab to read requested files on demand without uploading the entire folder to cloud storage upfront.

Step 1: Open Browser Quick Share in the Dashboard

  1. Sign in to your account at https://instawormhole.com.
  2. Navigate to the Quick Share section in your dashboard.
  3. Choose the option to share a folder of files from your computer.

Step 2: Select Your Local Folder

  1. In the browser file picker, select the target directory on your machine.
  2. Confirm browser permission to read the files inside the selected directory.
  3. Review the list of files detected in the folder before publishing the share link.

Step 3: Copy and Share the HTTPS URL

Once Quick Share initializes the session, InstaWormhole generates a public https:// URL mapped to your browser session.

  • Send the HTTPS link to your recipient so they can browse and download files directly.
  • Keep the Browser Quick Share tab open and your computer awake for as long as recipients need access.
  • Close the tab or end the session in the dashboard to immediately stop serving the folder.

Because Browser Quick Share serves files directly from your active browser tab, putting your laptop to sleep, closing the browser window, or refreshing away from the session ends access immediately.

Method 2: Share a Folder Using the InstaWormhole Connector

If you prefer serving a local directory through a local HTTP server and tunneling that port over HTTPS, use @instawormhole/connector. This approach gives you complete control over HTTP response headers, routing rules, MIME types, caching behavior, and custom ports while keeping your workflow inside the terminal.

Step 1: Serve Your Local Folder on Localhost

First, start a local static server pointing to the directory you want to share. For example, if you have a dist/ or public/ directory, you can serve it on a local port such as 8080 or 4173.

Using Node.js serve:

npx serve ./dist -l 8080

Using Python's built-in http.server module:

python3 -m http.server 8080 --directory ./dist

Using Vite's production preview server:

npm run preview -- --port 4173

If you are sharing a single-page application (SPA) built with React, Vue, or Svelte, note how your static server handles client-side routes. Tools like npx serve -s ./dist -l 8080 rewrite unknown subpaths back to index.html, whereas python3 -m http.server returns a 404 status code if a recipient refreshes a deep client-side route. Verify that your folder loads locally at http://localhost:8080 (or your chosen port) before starting the tunnel.

Step 2: Authenticate the Connector

If you have not yet linked your machine to your InstaWormhole account, authenticate the CLI connector once:

npx @instawormhole/connector login

Follow the browser authorization prompt to store your device credentials locally. Once authenticated, future commands can reuse those credentials with --stored-device.

Step 3: Expose the Local Port Over HTTPS

Point @instawormhole/connector at the local port serving your directory:

npx @instawormhole/connector expose --port 8080 --stored-device

The connector establishes an outbound connection to the InstaWormhole relay (wss://relay.instawormhole.site) and outputs your public https:// URL in the terminal. Because the connection is outbound over WebSockets, you do not need to open inbound ports on your router or configure firewall port forwarding. Anyone with that URL can now access your local folder over HTTPS.

Step 4: Configure Persistent Folder Sharing With instawormhole.toml

If you regularly share a local build folder or static site preview, create an instawormhole.toml file in your project root so you do not have to retype CLI flags every time:

relay = "wss://relay.instawormhole.site"

[[tunnels]]
name = "static-preview"
local_port = 8080

Start the tunnel using your configuration file:

npx @instawormhole/connector run --config instawormhole.toml --stored-device

You can also define multiple [[tunnels]] entries inside instawormhole.toml if your static folder needs to communicate with a local API server running on another port:

relay = "wss://relay.instawormhole.site"

[[tunnels]]
name = "static-preview"
local_port = 8080

[[tunnels]]
name = "local-api"
local_port = 3000

Running both tunnels from one configuration file lets you test cross-origin requests (CORS), authenticated cookies, and API integrations against real HTTPS origins without deploying either service.

Check What You Are Exposing Before You Share

Exposing a local directory over HTTPS makes every readable file inside that directory accessible to anyone who receives the link. Before sharing a Browser Quick Share URL or starting @instawormhole/connector, run through a quick pre-share audit to prevent accidental data leaks.

1. Inspect Hidden Files and Dotfiles

Local project folders frequently contain hidden configuration files that should never leave your machine. Check your target directory for:

  • .env, .env.local, or .env.production files containing API keys, database URLs, or webhook secrets.
  • .git/ directories, which expose your entire commit history, source code, and author metadata if served by a static file server.
  • .npmrc, .aws/, or SSH configuration files if you accidentally selected a parent directory instead of a build output folder.

Run ls -la in your terminal on the target folder before exposing it:

ls -la ./dist

If you see .env or .git inside the directory, move your shareable assets into an isolated subfolder (such as ./share or ./dist) and expose only that subfolder.

2. Verify You Selected the Build Output Folder, Not the Project Root

A common mistake when rushing to share a frontend prototype is pointing a static server or Quick Share picker at the repository root instead of the compiled output directory (dist/, build/, or out/). Exposing the project root exposes raw source code, package.json, lockfiles, and local scripts.

Always confirm the exact path you are sharing:

  • Share: ./dist, ./build, ./public-assets, or a dedicated ./handoff folder.
  • Do not share: . (your full repository root) or ~ (your home directory).

3. Check Directory Listing Behavior

When using a local static server with the CLI connector, check how the server behaves when someone visits the root URL (/):

  • If an index.html file is present, most static servers render that page directly.
  • If no index.html file exists, tools like npx serve or python3 -m http.server automatically generate a clickable HTML directory index listing every file and subfolder inside the directory.

If you want recipients to view a specific file without browsing neighboring files, either place those files in separate folders or share the direct path to the specific file.

4. Rotate or Close the Tunnel When Finished

Treat every public tunnel URL as temporary unless you explicitly configure access controls:

  • Browser Quick Share: Close the Quick Share browser tab as soon as the recipient confirms they have downloaded or reviewed the files.
  • CLI Connector: Press Ctrl + C in your terminal to terminate @instawormhole/connector and disconnect from the relay.
  • Access Controls: If you need to restrict who can open the link while the tunnel is live, configure access token protection in your InstaWormhole tunnel settings so unauthorized visitors cannot load the directory.

Troubleshooting Common Folder Sharing Issues

If your shared folder does not load as expected over HTTPS, check these common causes first:

  • CONNECTOR_UNAVAILABLE error: Confirm that npx @instawormhole/connector is still actively running in your terminal and that your workstation has an active internet connection to wss://relay.instawormhole.site.
  • config_invalid error: Validate your instawormhole.toml syntax, ensuring relay and each [[tunnels]] block use valid TOML formatting and accurate local_port numbers.
  • Connection refused or blank page: Verify that your local static server (npx serve, python3 -m http.server, or vite preview) is running on the exact port passed to --port or local_port, and confirm it binds to localhost or 127.0.0.1 (or 0.0.0.0).
  • Stale files appearing in the browser: Perform a hard refresh (Cmd + Shift + R on macOS or Ctrl + Shift + R on Windows/Linux) to bypass local browser caching of previously served static assets, or disable cache in your browser's Developer Tools while testing updates.

Summary Checklist for Sharing Local Folders Safely

  1. Isolate your files into a dedicated folder (./dist or ./handoff) with no .env or .git directories inside.
  2. Pick the right tool: Use Browser Quick Share for instant browser-based folder sharing, or @instawormhole/connector when serving a directory via a local HTTP server or instawormhole.toml.
  3. Verify locally first if using a local server so you know whether visitors will see an index.html page or an auto-generated directory listing.
  4. Shut down the session by closing the Quick Share tab or stopping the CLI process with Ctrl + C as soon as you finish sharing.

Originally published at https://instawormhole.com/blog/share-a-local-folder-over-https-without-deploying

๐Ÿ“ฐ Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.