qrcp
Transfer files over Wi-Fi via QR code
TLDR
Send a file or directories
Receive files
Compress content before transferring
Use a specific port
Use a specific network interface
Keep the server alive
SYNOPSIS
qrcp [options] files/directories
qrcp receive [options]
PARAMETERS
--help, -h
Displays usage information for the command.
--port
Specifies the port number for the web server (default is a random free port).
--address , -a
Binds the server to a specific IP address (e.g., 192.168.1.100).
--interface
Selects a network interface to use (e.g., eth0, wlan0).
--recursive, -r
Serves directories recursively. When used, a directory's contents are accessible.
--secure, -s
Uses HTTPS for the server (this is the default behavior).
--no-secure, -P
Disables HTTPS and uses plain HTTP.
--keep-alive, -k
Keeps the server running after the first transfer is complete, allowing multiple downloads.
--output
Specifies the output directory when in receive mode.
--tls-key
Path to a custom TLS private key for HTTPS.
--tls-cert
Path to a custom TLS certificate for HTTPS.
--url-only, -e
Prints only the URL to the console, without generating and displaying the QR code.
--zip
Compresses directories into a zip archive before serving, allowing easier download of multiple files.
--fqdn
Uses the Fully Qualified Domain Name (FQDN) instead of the local IP address in the generated URL.
--version, -v
Displays the qrcp version information and exits.
DESCRIPTION
qrcp is a command-line utility designed for effortless and secure file transfers between devices on the same local network. It simplifies the process by launching a temporary web server to host the specified files or directories. Upon activation, qrcp generates a QR code that encapsulates the direct download URL. Users can then scan this QR code with a smartphone or any QR-enabled device, allowing them to instantly access and download the shared content via their web browser.
This eliminates the need for USB cables, cloud services, or complex network configurations. By default, qrcp prioritizes security by using HTTPS with a self-signed certificate, ensuring that data is encrypted during transit within the local network. It's an ideal tool for quick, ad-hoc sharing of documents, photos, or any files between a computer and a mobile device, or even between two computers connected to the same Wi-Fi network. It also supports a receive mode, allowing the host to create an upload endpoint for others to send files.
CAVEATS
Local Network Dependency: qrcp relies on devices being on the same local network. It is not designed for transfers over the internet without additional networking setup (e.g., port forwarding).
Firewall Considerations: Local firewalls may block incoming connections to the qrcp server's port, requiring manual configuration.
HTTPS Browser Warnings: By default, qrcp uses a self-signed SSL/TLS certificate. Browsers will typically display security warnings (e.g., "Privacy error", "Not secure") when accessing the generated URL. Users must bypass these warnings to proceed with the download.
Ephemeral Nature: Unless --keep-alive is specified, the server shuts down after the first successful transfer, meaning subsequent attempts to download will fail.
QR Code Readability: For very long URLs (e.g., due to complex IP addresses or directories), the generated QR code might become dense and difficult for some scanners to read.
RECEIVE MODE
The qrcp receive command allows your computer to act as an upload endpoint. Instead of serving files, it creates a temporary web page where other devices can upload files to your machine. This is particularly useful for getting photos or documents from a mobile device onto a desktop.
SECURITY ON LOCAL NETWORKS
While qrcp defaults to HTTPS for encryption, it's important to remember that it operates on your local network. Any device connected to that network could potentially try to access the server if they know the IP address and port (even without the QR code). However, the ephemeral nature (server typically closes after one transfer) and random port selection enhance security for quick, ad-hoc transfers. Always be mindful of what network you are using for transfers.
HISTORY
qrcp emerged as a modern solution for a common problem: quickly sharing files between devices on a local network without relying on cloud services or complex configurations. Written in Go, it benefits from being a single static binary, making it easy to deploy and use across various Linux distributions and operating systems. Its development was driven by the desire for a simple, secure (defaulting to HTTPS), and convenient command-line tool. Since its initial release, qrcp has gained popularity among developers and general users alike for its straightforward approach, leveraging the ubiquity of smartphone QR code scanners to streamline local file transfers.