localgo

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: MIT

README

LocalGo

A Go implementation of the LocalSend v2.1 protocol for secure, cross-platform file sharing.

Go Version Protocol License

Features

  • Complete LocalSend v2.1 Protocol - Works with LocalSend apps
  • Secure - HTTPS with certificates, optional PIN protection
  • Fast Discovery - Multicast UDP + HTTP fallback
  • Multi-file Transfers - Send multiple files concurrently
  • Web Share - Share files via browser download link
  • Metadata Preserved - File timestamps preserved on transfer
  • Cross-Platform - Linux, macOS, Windows

Quick Start

Installation
# User installation (recommended)
./scripts/install.sh

# System-wide with systemd
sudo ./scripts/install.sh --mode system --service --create-user
Usage
# Start server to receive files
localgo-cli serve

# Discover devices
localgo-cli discover

# Send a file
localgo-cli send --file document.pdf --to "My Phone"

# Share files for web download
localgo-cli share --file document.pdf
Docker
# Start with Docker Compose
docker-compose up -d

# Or build and run manually
docker build -t localgo .
docker run -d --network host -v $(pwd)/downloads:/app/downloads localgo

Configuration

Environment Variables
Variable Default Description
LOCALSEND_ALIAS hostname Device name
LOCALSEND_PORT 53317 Server port
LOCALSEND_DOWNLOAD_DIR ./downloads Download directory
LOCALSEND_PIN - Optional PIN protection
LOCALSEND_FORCE_HTTP false Use HTTP instead of HTTPS
LOCALSEND_DEVICE_TYPE desktop Device type (mobile, desktop, server, etc.)
Example
export LOCALSEND_ALIAS="File Server"
export LOCALSEND_DOWNLOAD_DIR="/srv/files"
export LOCALSEND_PIN="123456"
localgo-cli serve

Commands

Command Description
serve Start server to receive files
share Share files via web download
discover Find devices via multicast
scan Find devices via HTTP scan
send Send files to a device
info Show device information
devices List discovered devices

Run localgo-cli help for more options.

Documentation

Detailed guides available in docs/:

Troubleshooting

Discovery not working:

# Use HTTP scan instead
localgo-cli scan --timeout 15

Port in use:

# Use different port
localgo-cli serve --port 8080

Permission denied:

# Fix download directory
chmod 755 ~/Downloads/LocalGo

License

MIT License - see LICENSE file.

Directories

Path Synopsis
cmd
localgo-cli command
pkg
cli
discovery
Package discovery handles device discovery mechanisms
Package discovery handles device discovery mechanisms
httputil
Package httputil provides HTTP utilities for LocalGo
Package httputil provides HTTP utilities for LocalGo
model
Package model contains the data structures used throughout the LocalGo application
Package model contains the data structures used throughout the LocalGo application
network
Package network provides network-related utilities for LocalGo
Package network provides network-related utilities for LocalGo
server
Package server provides HTTP server functionality for LocalGo
Package server provides HTTP server functionality for LocalGo
server/handlers
Package handlers contains HTTP handlers for the LocalGo server
Package handlers contains HTTP handlers for the LocalGo server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL