Sign inSign up

itrice/quick-share

By itrice

•Updated 2 months ago

文件共享:iPhone、Android、Windows之间互传文件,无需账号、无需安装。

Image
0

215

itrice/quick-share repository overview

⁠⚡ Quick Share

Zero-dependency LAN file sharing between iPhone, Android and Windows — no cloud, no accounts, no app installs. Run one tiny Node.js server on any device, then open a browser on any other device on the same Wi-Fi / network to send and receive files.

Source code: github.com/itrice/quick-share⁠

Works on: iPhone/iPad (Safari) · Android (Chrome) · Windows/macOS/Linux (any browser) · the device running the server.

Languages: the web UI supports English and 中文. It follows your browser language automatically, and you can switch anytime with the button in the header (中文 / English) — your choice is remembered.


⁠How it works

  1. Start the server on one device (the "host", e.g. your Windows PC).
  2. It prints addresses like http://192.168.1.5:8787 plus a QR code.
  3. On any other device, open that address in a browser (scan the QR with the phone camera, or type it).
  4. Drop / tap to choose files → they are saved into the received/ folder on the host device and listed on the page, downloadable from any device.

Files never leave your local network.


⁠Run it with Docker

Requires Docker⁠ (Docker Desktop on Windows/macOS, or the Docker engine on Linux).

docker compose up -d

This builds the image, maps port 8787, and mounts the local ./received folder so received files appear right next to the project files. Stop with docker compose down; view logs with docker compose logs -f.

⁠Option 2 — plain docker run
docker build -t quick-share .
docker run -d --name quick-share -p 8787:8787 -v ./received:/app/received quick-share
⁠Using it from Docker
  • On the Docker PC itself: http://localhost:8787
  • On phones / other PCs: http://<this-PC's-LAN-IP>:8787 (same Wi-Fi) — find the IP with ipconfig (Windows) or ip addr (Linux/macOS).
  • Received files land in the received/ folder you mounted.
  • To change the port, edit both sides of 8787:8787 (e.g. 9000:8787).

Linux note: the container runs as an unprivileged user. If uploads fail with a write error, make the host folder writable by it: sudo chown -R 1000:1000 ./received (this is not needed on Windows/macOS).


⁠Run it directly (no Docker)

⁠Windows
  1. Install Node.js⁠ (LTS — "Add to PATH" checked).
  2. Double-click start.bat in this folder. (Or in a terminal: node server.js.)
⁠macOS / Linux / Android (Termux)
node server.js
# or
./start.sh

On Android, install Termux, then pkg install nodejs and run the same command.

⁠Options (environment variables)
VariableDefaultMeaning
PORT8787TCP port
HOST0.0.0.0Interface to bind (127.0.0.1 = only this PC)
SHARE_DIR./receivedFolder where received files go
QS_MAX_MB2048Max upload size, 0 = unlimited

Example: PORT=9000 QS_MAX_MB=0 node server.js


⁠Running the tests

The project has a small automated test suite (no extra dependencies — it uses Node's built-in test runner, so it needs Node.js 18+):

npm test

It covers the file-API helpers (filename sanitizing, de-duplication, MIME mapping, path-traversal guards) and an end-to-end run against a real server instance (upload / download / delete, size limits, method errors, malformed requests). The end-to-end tests use a temporary share folder and never touch your real received/ folder.


⁠Using it

  • Send to the host: on the phone/PC, open the address → drop files or tap the box → progress bars → files appear in received/ on the host.
  • Grab from the host: any device can open the page and tap Download on any received file.
    • iPhone: tap Download, then Save to Files (or Share → Save Image for photos).
    • Android: tap Download; the file lands in the Downloads folder.
  • Delete a file from the list to remove it from the host.

⁠Troubleshooting

  • "Can't connect" / page won't open — all devices must be on the same network (same Wi-Fi; a guest network or VPN can block it). Try the http://192.168.x.x:8787 address, not localhost, from other devices.
  • localhost works but http://192.168.1.x:8787 does not, on the same PC — your PC is routing traffic through a proxy / VPN app (the server even warns about this at startup). The proxy tries to reach your LAN address and fails. Fixes:
    • Windows: Settings → Network & Internet → Proxy → add 192.168.1.66 (or your LAN IP) to the bypass list, or enable "Bypass proxy servers for local addresses". If you use a VPN app (Clash, V2Ray, etc.), enable its "bypass LAN / private IPs" option instead.
    • Firefox: Settings → Network Settings → "No proxy for" → add the LAN address.
    • macOS / Linux: add the LAN address to no_proxy, e.g. export no_proxy=192.168.1.66,localhost,127.0.0.1.
    • Or simply test from your phone instead — phones connect directly and are never affected by your PC's proxy.
  • Windows firewall prompt — click Allow when Windows asks to permit Node.js on private networks.
  • Phone hotspot — if the host is a PC, connect the phone to the PC's hotspot instead of using the router Wi-Fi.
  • Wrong network — the printed 192.168.x.x address is the one to use; restart the server if it changed. The startup screen self-checks every printed address and marks any that aren't reachable (✓ / ⚠).

⁠Security

Quick Share is a plain-HTTP tool for trusted local networks. Anyone who can reach the printed address can upload files to and download files from the share folder, and traffic is not encrypted. Do not forward the port to the public internet (no port forwarding, no UPnP, no exposing it in Docker/ngrok).

⁠License

MIT. The bundled public/vendor/qrcode.js is the QR Code Generator for JavaScript⁠ by Kazuhiko Arase, also MIT-licensed.

Tag summary

Content type

Image

Digest

sha256:f2cf37300…

Size

55.1 MB

Last updated

2 months ago

docker pull itrice/quick-share