tailscale-localsend
Tailscale + LocalSend Peer Discovery
Discover peers via Tailscale mesh and exchange files via LocalSend protocol.
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Tailscale API │────▶│ Peer Discovery │────▶│ LocalSend API │
│ (mesh network) │ │ (propagator) │ │ (file xfer) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Discovery Flow
- Tailscale Status:
tailscale status --json→ get mesh peers - LocalSend Probe: UDP multicast 224.0.0.167:53317 → find localsend-enabled peers
- Intersection: Peers on both networks get deterministic Gay.jl colors
Usage
# Discover peers on tailscale with localsend
just ts-localsend-discover
# Send file to peer
just ts-localsend-send <peer> <file>
# Receive mode
just ts-localsend-receive
Python API
from tailscale_localsend import TailscaleLocalSend
tls = TailscaleLocalSend(seed=0x6761795f636f6c6f)
# Discover peers
peers = tls.discover()
# [{'name': 'macbook', 'tailscale_ip': '100.x.x.x', 'localsend_port': 53317, 'color': '#A855F7'}]
# Send file
tls.send(peer='macbook', file='data.json')
# Receive (blocking)
tls.receive(callback=lambda f: print(f"Got {f}"))
Protocol Details
Tailscale Discovery
- Uses
tailscale status --jsonfor mesh peers - Extracts TailscaleIPs for each peer
- Falls back to Tailscale API if CLI unavailable
LocalSend Protocol
- Multicast: 224.0.0.167:53317 (UDP)
- Announce: JSON with alias, fingerprint, port
- Transfer: REST API over HTTPS
POST /api/localsend/v2/prepare-uploadPOST /api/localsend/v2/upload?sessionId=...
Color Assignment
Each peer gets deterministic color from Gay.jl:
peer_color = gay_color_at(hash(peer_fingerprint) % 1000, seed=GAY_SEED)
Integration with epistemic-arbitrage
from epistemic_arbitrage import ArbitrageNetwork
network = ArbitrageNetwork(seed=1069)
for peer in tls.discover():
network.add_cell(peer['name'], knowledge=peer.get('files', 0))
# Propagate knowledge between peers
network.add_propagator(:peer_sync, sources, targets)
network.run_parallel(n_workers=len(peers))
Commands
just ts-peers # List tailscale peers
just ls-peers # List localsend peers
just ts-ls-bridge # Bridge both networks
Base directory: ~/.codex/skills/tailscale-localsend
More from plurigrid/asi
academic-research
Search academic papers across arXiv, PubMed, Semantic Scholar, bioRxiv, medRxiv, Google Scholar, and more. Get BibTeX citations, download PDFs, analyze citation networks. Use for literature reviews, finding papers, and academic research.
49wev-tesseract
WEV Tesseract Skill
33tree-sitter
AST-based code analysis using tree-sitter. Use for parsing code structure, extracting symbols, finding patterns with tree-sitter queries, analyzing complexity, and understanding code architecture. Supports Python, JavaScript, TypeScript, Go, Rust, C, C++, Swift, Java, Kotlin, Julia, and more.
21alife
Comprehensive Artificial Life skill combining ALIFE2025 proceedings, classic texts (Axelrod, Epstein-Axtell), ALIEN simulation, Lenia, NCA, swarm intelligence, and evolutionary computation. 337 pages extracted, 80+ papers, 153 figures.
16reverse-engineering
Reverse Engineering Skill
16bdd-mathematical-verification
BDD-Driven Mathematical Content Verification Skill
16