• Stars
    star
    4,336
  • Rank 9,919 (Top 0.2 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ• Peer-to-peer file transfers in your browser

XKCD 949 FilePizza wordmark

Peer-to-peer file transfers in your browser

Cooked up by Alex Kern & Neeraj Baid while eating Sliver @ UC Berkeley.

Using WebRTC, FilePizza eliminates the initial upload step required by other web-based file sharing services. When senders initialize a transfer, they receive a "tempalink" they can distribute to recipients. Upon visiting this link, recipients' browsers connect directly to the senderโ€™s browser and may begin downloading the selected file. Because data is never stored in an intermediary server, the transfer is fast, private, and secure.

A hosted instance of FilePizza is available at file.pizza.

Requirements

  • node 0.12.x
  • npm 2.x.x

Installation

The recommended way to deploy FilePizza is as a Docker container. WebRTC only works over HTTPS, so you'll either have to get a signed HTTPS key/certificate from a CA such as Let's Encrypt or generate your own self-signed pair and trust it. Then, to run FilePizza (with HTTPS termination):

$ docker run \
    -p 8080:8080 -e PORT=8080 \
    -e HTTPS_KEY=/config/server.key \
    -e HTTPS_CERT=/config/server.crt \
    -v mylocalpath:/config \
    -it kern/filepizza:master

You can specify your own ICE STUN/TURN servers for better connectivity behind NATs by passing a JSON encoding of the array via env var ICE_SERVERS. Alternatively, if you'd like to use Twilio's STUN/TURN service, you can specify your SID and token using the TWILIO_SID and TWILIO_TOKEN environment variables, respectively.

You can specify your own Webtorrent tracker(s) using the WEBTORRENT_TRACKERS environment variable, comma-delimited.

If you want to use Google Analytics, you can specify your UA code using the GA_ACCESS_TOKEN="UA-00000000-1" environment variable.

Development

$ git clone https://github.com/kern/filepizza.git
$ npm install
$ npm run-script build
$ npm start

FilePizza is an isomorphic React application which uses the Flux application architecture. ES6 features are used liberally and compiled using Babel. Views are rendered on the server, store data is serialized and sent to the client, which then picks up where the server left off.

Both client and server JavaScript files can be found in lib/. lib/server.js and lib/client.js are the server and client entrypoints, respectively. lib/components/, lib/stores/, and lib/actions/ contain the corresponding Flux modules, implemented using alt. lib/routes.js serves as the isomorphic routes file using react-router.

Client-side JavaScript and CSS are compiled using webpack and are available at /app.js.

FAQ

Where are my files sent? Your files never touch our server. Instead, they are sent directly from the uploader's browser to the downloader's browser using WebTorrent and WebRTC. This requires that the uploader leave their browser window open until the transfer is complete.

Can multiple people download my file at once? Yes! Just send them your tempalink.

How big can my files be? Chrome has issues supporting files >500 MB. Firefox does not have any issues with large files, however.

What happens when I close my browser? The tempalink is invalidated. If a downloader has completed the transfer, that downloader will continue to seed to incomplete downloaders, but no new downloads may be initiated.

Are my files encrypted? Yes, all WebRTC communications are automatically encrypted using public-key cryptography.

My files are sending slowly! Transfer speed is dependent on your network connection.

Troubleshooting

If you receive a Error: EMFILE, too many open files error when running npm start on a Mac, this is a result of Browserify's compilation step opening up a large number of npm modules all at once. You'll have to increase the maximum number of open files allowed on your system:

$ sysctl -w kern.maxfiles=20480

License & Acknowledgements

FilePizza is released under the BSD 3-Clause license. A huge thanks to WebTorrent which we use for the file transfers under the hood, and to iblowyourdesign for the pizza illustration.

More Repositories

1

hackbot

โ˜• Hackbot adds features to Facebook Groups through automation
JavaScript
100
star
2

ditto

๐Ÿ”  An iOS keyboard for quickly composing repetitive emails.
Swift
33
star
3

fb_scrape

A simple scraper for Facebook Groups.
Ruby
26
star
4

zeppelin

๐Ÿ’ฅ Urban Airship library for Ruby
Ruby
21
star
5

kern.io

:shipit: My personal site's source code.
TypeScript
20
star
6

gifty

๐ŸŽ Send NFTs via a URL/SMS (API & bridge service) โ€” ETHSanFrancisco 2018
TypeScript
18
star
7

supercharged

๐Ÿƒโ€โ™‚๏ธ Natural language activity tracking with GPT-3
TypeScript
13
star
8

debug-solidity

๐Ÿ–จ๏ธ Solidity library and related contracts for debugging contracts
Solidity
12
star
9

microdao

๐Ÿค Light-weight DAOs/multi-sigs using CREATE2.
TypeScript
10
star
10

dotfiles

@kern's dotfiles
Vim Script
10
star
11

bhrobotics.com

Source of bhrobotics.com
Ruby
7
star
12

thingsapi

๐Ÿ“ฅ Utility to access Things Cloud via the terminal
TypeScript
6
star
13

startup.berkeley.edu

๐Ÿป Startup@Berkeley provides curated entrepreneurial resources for students at the University of California, Berkeley. This repository holds the source code for the site.
HTML
6
star
14

jason

Insanely simple JSON templates
Ruby
6
star
15

text-alias

:shipit: Strings should just be called texts
TypeScript
5
star
16

mortorq

The Beverly Hills High School FIRST Robotics Competition robot code
Java
5
star
17

bayes-whales

๐Ÿณ Image classifier for finding quality ocean images in the NOAA Whales Aerial dataset (Bayes Hack 2016)
Python
4
star
18

organize

Organize your Mac filesystem
Ruby
4
star
19

kernbernetes

Devops stuff for personal projects.
Shell
3
star
20

marble

Ruby object builder
Ruby
3
star
21

fisidesktop

Fuck it, Ship it for your Desktop
Objective-C
3
star
22

filepizza-peerjs

Isomorphic helper module for FilePizza's PeerJS
JavaScript
2
star
23

deploybot

An opinionated deployment bot for Slack + GitHub Deployments
TypeScript
2
star
24

salt

Create custom HTML tags
Ruby
2
star
25

webbed

Take control of HTTP.
Ruby
2
star
26

scss-boilerplate

Simple SCSS boilerplate
2
star
27

experiments

Experimental programming stuff I work on.
Ruby
1
star
28

sasset

Asset hosts with SASS/SCSS
1
star
29

staked

๐Ÿ“ฆ Docker and Packer image configurations for staking nodes
Shell
1
star
30

matchbox

Use RSpec and Shoulda matchers in Test::Unit
Ruby
1
star
31

jacuzzi.js

Simple event pooling for any JavaScript object
JavaScript
1
star
32

yoplaysflappy

Yo Plays Flappy Bird
JavaScript
1
star
33

docker-mosh

๐Ÿณ Docker image for mosh
1
star
34

autismband

Ruby
1
star
35

presentations

Presentations I've done
1
star
36

beverlyhacks

Source code for the website of BeverlyHacks
HTML
1
star
37

morlib

Asynchronous FRC Programming Library
Java
1
star
38

truisms

Utilities for working with text messages.
Ruby
1
star
39

zap-airtable

โ›ˆ Use Google Cloud Functions to add records to Airtable
TypeScript
1
star