Skip to content

bethropolis/localgo

Repository files navigation

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
  • Clipboard Integration - Incoming text/plain transfers copied to clipboard automatically
  • 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

# or using go (no service and completions)
go install github.com/bethropolis/localgo/cmd/localgo@latest

Usage

# Start server to receive files
localgo serve

# Discover devices
localgo discover

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

# Share files for web download
localgo 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/laptop/tablet/server/headless/web/other)
LOCALSEND_DEVICE_MODEL LocalGo Device model string
LOCALSEND_AUTO_ACCEPT false Auto-accept incoming files without prompting
LOCALSEND_NO_CLIPBOARD false Save incoming text as a file instead of clipboard
LOCALSEND_LOG_LEVEL info Log verbosity (debug/info/warn/error)

Example

export LOCALSEND_ALIAS="File Server"
export LOCALSEND_DOWNLOAD_DIR="/srv/files"
export LOCALSEND_PIN="123456"
localgo 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 help for more options.

Documentation

Detailed guides available in docs/:

Troubleshooting

Discovery not working:

# Use HTTP scan instead
localgo scan --timeout 15

Port in use:

# Use different port
localgo serve --port 8080

Permission denied:

# Fix download directory
chmod 755 ~/Downloads/LocalGo

License

MIT License - see LICENSE file.

About

a golang implementation of the localsend protocol

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors