Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DocterJac/pairlane

 
 

Repository files navigation

Pairlane

日本語 | 中文

Live Demo: https://getpairlane.com/

A P2P file sharing tool using WebRTC. Transfer files directly between browsers without going through a server.

Features

  • P2P Transfer: Files are sent directly between browsers, not through a server
  • E2E Encryption (Optional): AES-GCM encryption with key in URL fragment (#k=...), never sent to server
  • Serverless: Runs on Cloudflare Workers + Durable Objects, no file storage on server
  • Multiple Receivers: One sender can transfer to multiple receivers simultaneously (configurable concurrency)
  • Drag & Drop: File selection UI supports drag and drop

How It Works

  1. Sender creates a room
  2. Share the link (or room code) with receivers
  3. Receivers join the room
  4. Sender selects a file and sends
  5. P2P transfer via WebRTC DataChannel

Tech Stack

CLI

Send and receive files directly from your terminal. Works with browsers and other terminals.

Quick Start

# Send a file
npx pairlane send /path/to/file

# Receive a file
npx pairlane receive <ROOM_ID_OR_URL> --output-dir ./downloads

Encryption

Encryption is enabled by default. The send command prints a room URL with #k=... that you can share:

npx pairlane send /path/to/file
# → Share the printed URL: https://getpairlane.com/r/<ROOM_ID>#k=<KEY>

npx pairlane receive "https://getpairlane.com/r/<ROOM_ID>#k=<KEY>"

To disable encryption, pass --no-encrypt.

Options

Option Description
--output-dir Directory to save received files
--key <KEY> Provide decryption key explicitly (base64url)
--stay-open Keep running after transfer for additional transfers
--no-encrypt Disable encryption for send

Custom Endpoint

By default, the CLI connects to https://getpairlane.com. Override with:

PAIRLANE_ENDPOINT=https://your-server.com npx pairlane send /path/to/file

Supported Platforms

  • Linux (x86_64)
  • macOS (Intel / Apple Silicon)

Build from Source

cd cli
cargo run --release -- send /path/to/file
cargo run --release -- receive <ROOM_ID_OR_URL> --output-dir ./downloads

Prerequisites

Development

bun install
bun run dev

Vite dev server runs SSR on http://localhost:5173.

Build

bun run build

Deploy

bun run deploy

Generate Cloudflare Types

For generating/synchronizing types based on your Worker configuration run:

bun run cf-typegen

Bindings Configuration

Pass the CloudflareBindings as generics when instantiating Hono:

// src/index.tsx
type Bindings = CloudflareBindings & { ROOM: DurableObjectNamespace }
const app = new Hono<{ Bindings: Bindings }>()

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 57.1%
  • Rust 27.6%
  • CSS 13.1%
  • JavaScript 2.2%