Beaker: free and open-source peer-to-peer web browser
WIKI: Beaker provides the user with tools for publishing and hosting websites directly from the browser; all files and websites are transferred using Dat, a hypermedia peer-to-peer protocol. The browser also supports the HTTP protocol. Beaker is built using the Electron framework and therefore uses the Chromium browser as a renderer for webpages.
Install Beaker (macOS, Windows, GNU/Linux)https://beakerbrowser.com/install/
Build Beaker from source
Building Beaker from source requires Node 6 or higher. If you’re on Linux (and in some cases macOS), you’ll also need libtool, m4, and automake:
sudo apt-get install libtool m4 make g++ # debian/ubuntu
sudo dnf install libtool m4 make gcc-c++ # fedora
Clone Beaker’s source from GitHub, install the dependencies, and run the build:
git clone https://github.com/beakerbrowser/beaker.git
npm run rebuild #see https://github.com/electron/electron/issues/5851
If you pull latest from the repo and get weird module errors, run:npm run burnthemall
This invokes the mad king, who will torch your node_modules/, and do the full install/rebuild process. npm start should work afterwards.
AppImage & GNU/Linux
An AppImage is a type of cross-distribution packaging (or bundling) format. It is essentially a self-mounting (using Filesystem in Userspace, or FUSE for short) disk image containing an internal file system for running the application it provides. This internal file system includes all the binaries and libraries required by the application that cannot be reasonably expected to be provided by the base operating system (that is, the Linux system on which the AppImage is being run). To be run they first need to be marked executable (with chmod +x , where is the file name of the AppImage, including its file extension) and then run with ./. Either that or clicked/double-clicked in one's file manager.
Paul released the Beaker prototype in August 2016 after participating in the inaugral Decentralized Web Summit, where he shopped his idea to integrate peer-to-peer protocols into a browser.
Tara made her first contribution in October 2016 and joined full-time in April 2017. As core developer of the Dat protocol, Mathias has always been a part of the Beaker community, but he officially joined the Beaker team in 2018.
Peer-to-peer protocols and Beaker
The peer-to-peer Web is a loose term for websites and apps that are transported with a peer-to-peer protocol instead of HTTP.
There are many peer-to-peer (p2p) protocols with subtle differences, but they share some important properties:
- Files are not bound to any one IP address or server
- You download files from other people on the network
- Anyone can become an uploader (or seeder), contributing bandwidth to help host files
We call Beaker a p2p browser because it supports a p2p protocol called Dat (dat://). Adding dat:// support in the browser made it possible for Beaker to provide experimental new features:
- Publishing websites and files from the browser, no server required
- APIs for building p2p apps
- Powerful View Source and in-browser editor
- Live reloading, offline sync, and more
Browsing with Beaker
Beaker is an experimental peer-to-peer browser. Just like other browsers, you can browse http:// and https:// websites
Beaker also supports a peer-to-peer protocol called Dat, which means you can browse dat:// websites like dat://beakerbrowser.com.
Learn more about dat: https://datproject.org/
Core concept: peers and seeding
dat:// is a peer-to-peer protocol, which means that visitors to a dat:// site connect directly to one another, downloading and sharing files. Participants on the network are called peers, and when a peer contributes bandwidth to re-upload a site’s files, it’s called seeding. You can see the peer count for a dat:// site in the URL bar.
When you you visit a dat:// site with Beaker, you temporarily seed its files. If you want to contribute resources to that site for longer, you can use the seeding menu in the URL bar. If you visit an https:// website that also supports dat://, you’ll see this indicator in Beaker’s URL bar.
dat:// websites are unique because you can inspect all the files that make up a website. To explore a dat:// website’s files, click “View Source” in the site’s dropdown menu. This is Beaker’s View Source tool. You can view any dat:// site and its files with View Source. View Source automatically renders README files. And of course, you can inspect individual files with View Source too.
One of the most compelling reasons for supporting dat:// in Beaker is that it makes it possible to share a website from the browser with one click!
To create a website with Beaker, click “Create New” in the main dropdown menu. Then choose whether to create an empty project, use our basic website template, or to import an existing project. We’ll choose the basic website template. Beaker will automatically create a new dat:// website, populate it with a simple template, then open the website in View Source.
We can open the website with the link on the top right. Just like that, we made a website! To share the website with friends, we can send them the website’s URL. Anyone with the URL will be able to view the website in Beaker.
Beaker’s built-in editor
Since dat:// makes it possible to publish files directly from Beaker, wouldn’t it be great if you could also edit files in Beaker? You can!
Let’s open our website in View Source, then open its index.html. If we click the edit button, we’ll be able to update the HTML directly from View Source!
Using your own editor
Prefer to use Sublime, Vim, Atom, or Code to edit your projects? You can click the “Set local directory button” to sync the website’s files to a directory on your computer. Any changes you make to the files in the directory will be published to the website.
“Forking” or copying a website
You can edit websites you’ve created, but you can’t edit other people’s websites. Beaker provides a built-in tool to make an editable copy of any dat:// website. If you’re familiar with GitHub, it’s kind of like “forking” a project.
Making an editable copy is especially useful when you want to customize a p2p app. For example, let’s say you use dat://fritter.hashbase.io as your social media client, but you don’t like round buttons. You could make an editable copy, then customize the CSS to change the button styles, all without losing your user data or friends list!
Beaker has a built-in live-reloading tool for all dat:// pages. Turn on live reloading, and Beaker will automatically reload the page.
Live reloading works for projects you’re working on locally and for remote projects on the peer-to-peer network!
Equalizing access to publishing
Peer-to-peer websites are exciting because they enable anyone to create and publish a website without needing to know how to run a server. As long as someone else on the network is seeding your website’s files, it will stay online.
What’s so special about peer-to-peer apps?
On the p2p Web, files are transmitted directly between computers instead of from servers to computers. Because participants can connect directly to one another, it makes it possible to build apps with entirely new architectures that don’t necessarily require managing a database or paying for a server!
Instead of making a request to a database or server, when the app needs to update the user’s profile or store new data, it can use browser APIs to read and write to the peer-to-peer website that contains the user’s profile and data.
This has a few advantages:
- Users control their own profiles and data
- Developers can launch applications that use profiles without needing to set up a server or database
- There’s no third-party server in charge of managing millions of user’s profiles
Seeding, hosting, pinning, say what?
Seeding is the process of re-uploading or re-sharing a file on a peer-to-peer network. You might also hear it called pinning, hosting, re-hosting, or re-uploading, but in Beaker, we usually call it seeding.
In a peer-to-peer network, participants connect directly to one another, requesting and sharing files. While a server-like device may be one of the participants on the network, a server has no special permissions or responsibilities—instead, each participant contributes bandwidth and storage resources to help transport files.
Etiquette on peer-to-peer networks
When you download a file on a peer-to-peer network, it’s important to also re-upload or seed it to make sure that the network stays healthy! The network works best when all participants share the burden of transporting files.
Seeding and Beaker
When you visit a dat:// website with Beaker, you temporarily seed the files you’ve downloaded. When you navigate away from the website or close its tab, you will no longer be seeding its files.
You only seed files that you explicitly view or download. For example, if the website has a video file, but you don’t navigate to a page that loads the video, you will not download or seed the video.
Manually controlling seeding
If you want to continue seeding a website after you visit it, you can use the seeding menu in Beaker’s URL bar.
Keeping your p2p website online
It’s not practical to keep your computer on all the time, but don’t worry! There are plenty of other ways to keep your website’s files online:
Hashbase: Hosting for the peer-to-peer Web
Hashbase is a public peer for files published with the Dat protocol. We keep your files online while your computer is off. Dat is a peer-to-peer protocol for sharing datasets and files. When you use Dat, your files are distributed across the network of peers who you've shared your files with. Publishing with Dat means that peers will contribute bandwidth, but only if they're online and sharing your files. If nobody's hosting your files, then they won't be accessible. That's where Hashbase comes in. We act as a "super peer" that makes sure your content is always available.