Simple P2P file sharing and persistence server using WebTorrent https://share.vski.ai/
  • TypeScript 97.9%
  • Dockerfile 2%
Find a file
Anton Nesterov 02d4c40d5a
All checks were successful
Deploy Git / build (push) Successful in 1m3s
chore: update web
2026-03-01 14:38:15 +01:00
.forgejo/workflows chore: deploy 2026-03-01 13:42:08 +01:00
.zed init 2026-03-01 13:15:38 +01:00
__test__ init 2026-03-01 13:15:38 +01:00
server@d3a9d9250b init 2026-03-01 13:15:38 +01:00
web@55a98d1df8 chore: update web 2026-03-01 14:38:15 +01:00
web_tracker chore: deploy 2026-03-01 14:00:04 +01:00
.gitignore init 2026-03-01 13:15:38 +01:00
.npmrc chore: deploy 2026-03-01 13:56:32 +01:00
AGENTS.md init 2026-03-01 13:15:38 +01:00
docker-compose.yml chore: deploy 2026-03-01 13:50:56 +01:00
Dockerfile chore: deploy 2026-03-01 14:00:04 +01:00
README.md init 2026-03-01 13:15:38 +01:00
test.dockerfile add testing dockerfile 2026-03-01 13:19:07 +01:00

ViShare

Peer-to-peer file sharing via WebTorrent magnet links. Share files directly between browsers without uploading to a server.

Features

  • P2P File Sharing: Files are shared directly between peers using WebTorrent
  • QR Code Sharing: Generate QR codes for easy mobile sharing
  • QR Scanner: Scan QR codes to download shared files
  • Multiple Files: Share multiple files in a single torrent
  • Persistent Downloads: Downloads persist across page reloads
  • Mobile-Friendly: Responsive UI optimized for mobile devices
  • Optional Server: Magnet server can persist shares for offline availability
  • DeltaChat/Telegram Bot: Bot interface for sharing via messaging apps

Architecture

vishare/
├── tracker/       # wt-tracker - WebSocket tracker for peer discovery
├── server/        # Node.js server - persists torrents, HTTP/HTTPS API
├── web/           # React/Vite web app - file sharing UI
└── src/           # Deno bot - DeltaChat/Telegram integration

Quick Start

1. Start the Tracker

cd tracker
npm install
npm run build
npm run start:dev

Tracker runs on:

  • HTTP: ws://localhost:8000
  • HTTPS: wss://localhost:8443

2. Start the Server (optional)

cd server
pnpm install
pnpm run dev

Server runs on:

  • HTTP: http://localhost:3100
  • HTTPS: https://localhost:3443

3. Start the Web App

cd web
pnpm install
pnpm run dev

Web app runs on https://localhost:5173 (HTTPS required for camera access)

Usage

Sharing Files

  1. Open the web app
  2. Drag & drop files or tap to select
  3. Click "Share" to create a magnet link
  4. Share via "Show QR" or "Copy Link"

Downloading Files

  1. Go to the Download tab
  2. Paste a magnet link or scan a QR code
  3. Wait for download to complete
  4. Click the file to save

Configuration

In Settings, you can:

  • Add/remove tracker URLs
  • Add/remove magnet servers
  • Select active server for persistence

Development

Prerequisites

  • Node.js 18+ (for server and tracker)
  • pnpm (for server and web)
  • Deno (for bot)

Commands

# Tracker
cd tracker && npm run dev

# Server
cd server && pnpm run dev

# Web app
cd web && pnpm run dev

# Bot
deno task dev

Self-Signed Certificates

For development, self-signed certificates are in certs/:

  • cert.pem - Certificate
  • key.pem - Private key

Generate new ones:

openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodes -subj "/CN=localhost"

Technical Details

magnet:?xt=urn:btih:<infohash>&dn=<share_name>&tr=<tracker_url>
  • xt - Infohash (required)
  • dn - Display name (human-readable share name)
  • tr - Tracker URL

WebTorrent in Browser

WebTorrent is loaded via CDN (esm.sh) because it has Node.js dependencies that can't be bundled. The global WebTorrent is available after the script loads.

IndexedDB Persistence

  • Shares with "sharing" status are persisted
  • Downloads are persisted (files must be re-downloaded after reload)
  • Blob URLs don't survive page reloads

License

MIT