Skip to content

Repository files navigation

Light

Light

Fast, local, private file sharing

Go Wails Vue Tailwind License


How It Works

  1. Discovery — Devices broadcast their presence via UDP beacons on the local network (port 9129). Each device periodically sends a JSON heartbeat containing its ID, name, type, and transfer port. Other devices listen and maintain a live device table with a 10-second TTL.
  2. Pairing — Scan a QR code or enter a 6-digit code to connect devices across subnets, or when auto-discovery doesn't reach them.
  3. Transfer — The sender streams files over plain HTTP to the receiver's device. Each file is sent with a SHA-256 checksum header for integrity verification.
  4. Accept/Reject — The receiver sees an incoming file prompt and can accept or decline. Auto-accept can be enabled in settings.
  5. Progress — Real-time progress, speed, and ETA are shown for every transfer. Pause, resume, and cancel are supported.

Features

  • Zero Config — Auto-discovery on LAN, no manual setup required
  • Cross-Platform — Windows, macOS, Linux, Android, iOS via Wails v3
  • QR Pairing — Scan a QR code or enter a 6-digit code to connect devices
  • Real-time Progress — Live speed, ETA, and per-file progress tracking
  • Pause / Resume / Cancel — Full transfer control at any time
  • Accept / Reject — Incoming files require consent (or auto-accept)
  • Transfer History — Completed and failed transfers are logged
  • Dark Theme — Industrial-utilitarian design with amber accents

Tech Stack

Layer Technology
Backend Go 1.25 + Wails v3
Frontend Vue 3 + TypeScript + Vite 8 + Tailwind CSS 3
Discovery UDP broadcast beacons (port 9129)
Transfer Plain HTTP (port 9120, configurable)
History JSON file (~/.light/history.json)
QR skip2/go-qrcode + jsQR (browser)

Project Structure

main.go                      Wails composition, embedded assets
internal/light/              Go backend package
  models.go                  Domain types (Device, Transfer, Settings, etc.)
  settings.go                SettingsService — config persistence + device ID
  discovery.go               DiscoveryService — UDP beacon broadcast + Diagnostics
  filetransfer.go            FileTransferService — HTTP server + sender upload
  transfermanager.go         TransferManager — progress tracking + JSON history
  qr.go                      QRCodeService — QR generation + pairing codes
  broadcast_windows.go       SO_BROADCAST (Windows, syscall)
  broadcast_unix.go          SO_BROADCAST (Linux/macOS/Android, syscall)
frontend/                    Vue 3 application + generated Wails bindings
  src/
    composables/             Reactive stores (useDiscovery, useTransfers, useSettings, useUI)
    components/              UI components (devices, transfer, pair, common, layout)
    views/                   Page views (Send, Receive, History, Settings)
    styles/                  Tailwind CSS + design tokens
    lib/                     Helpers (event listener, byte formatting)
build/                       Wails platform/build configuration

Download

Platform Link
Windows Installer
Android APK

Quick Start

Prerequisites

Development

# Clone the repository
git clone https://github.com/Aswanidev-vs/light.git
cd light

# Install dependencies
cd frontend && npm install && cd ..

# Start development server
wails3 dev

Build

# Build for current platform
wails3 build

# Build Windows
GOOS=windows wails3 build

# Build Android APK
wails3 task android:package

Configuration

Settings are stored in ~/.light/settings.json:

{
  "deviceName": "My Device",
  "port": 9120,
  "downloadDir": "~/Downloads/Light",
  "autoAccept": false,
  "theme": "dark",
  "enableEncryption": false
}
Field Default Description
deviceName hostname Name shown to other devices
port 9120 TCP port for the file transfer HTTP server
downloadDir ~/Downloads/Light Where received files are saved
autoAccept false Accept incoming files without prompting
theme dark UI theme (dark only for now)

Architecture

┌─────────────────────────────────────────────────┐
│                   Frontend (Vue 3)              │
│  SendView · ReceiveView · HistoryView · Settings │
│         ↕ Events.On / wails.Call                │
├─────────────────────────────────────────────────┤
│               Wails v3 bindings                  │
│         ↕ app.Event.Emit / exported methods      │
├─────────────────────────────────────────────────┤
│                 Go Backend                       │
│  DiscoveryService ── UDP broadcast (9129)        │
│  FileTransferService ── HTTP server (9120)       │
│  TransferManager ── progress + JSON history      │
│  QRCodeService ── QR generation + pairing codes  │
│  SettingsService ── config persistence           │
└─────────────────────────────────────────────────┘
         ↕ UDP beacons         ↕ HTTP transfer
┌──────────────┐         ┌──────────────┐
│  Peer Device  │ ◄─────► │  Peer Device  │
└──────────────┘         └──────────────┘

Discovery Protocol

The old mDNS-based discovery was replaced with a simpler, more reliable UDP beacon broadcast protocol:

  • Port: 9129 (fixed UDP)
  • Beacon payload: { id, name, type, port, pairingCode, ts }
  • Send: Per-interface directed broadcast + 255.255.255.255 + loopback (all unconditionally, not fallback-on-error)
  • Receive: Wildcard UDP socket on 0.0.0.0:9129
  • Device ID: Persisted crypto/rand UUID in ~/.light/deviceid (never derived from a cert, never a constant)
  • Diagnostics: Diagnostics() RPC + loopback self-test separates "socket broken" vs "packets not crossing network" vs "peer not answering"

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with care for fast, private file sharing

About

Light is a zero-config, cross-platform file-sharing tool for local networks. Built with Go and Vue 3, it uses UDP beacons for instant device discovery and QR codes for secure pairing. Transfer files instantly with real-time progress, checksum verification, and a privacy-first design. No internet required.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages