• No results found

Peer-to-peer distribution of web content using WebRTC within a web browser

N/A
N/A
Protected

Academic year: 2022

Share "Peer-to-peer distribution of web content using WebRTC within a web browser"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

TVE 15 036

Examensarbete 15 hp Juni 2015

Peer-to-peer distribution of

web content using WebRTC within a web browser

Kerstin Ersson

Siri Persson

(2)

Teknisk- naturvetenskaplig fakultet UTH-enheten

Besöksadress:

Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0

Postadress:

Box 536 751 21 Uppsala

Telefon:

018 – 471 30 03

Telefax:

018 – 471 30 00

Hemsida:

http://www.teknat.uu.se/student

Abstract

Peer-to-peer distribution of web content using WebRTC within a web browser

Kerstin Ersson, Siri Persson

The aim of this project was to investigate if it is possible to host websites using the BitTorrent protocol, a protocol for distribution of data on the web. This was done using several Node.js modules, small clusters of code written in JavaScript, such as Browserify and a modified version of WebTorrent. In these modules, technologies like websockets and WebRTC are implemented. The project resulted in a working WebTorrent module, implemented on the website www.peerweb.io. However, the module still needs optimization concerning the time it takes to set up a WebRTC peer connection.

With these modifications, we believe that hosting websites via peer-to-peer network will be the future of the web.

Handledare: Magnus Lundstedt

(3)

Populärvetenskaplig sammanfattning

En fråga av stor vikt i dagens informationstekniska samhälle är hur data effektivt ska distribueras på nätet. Våra tidspressade scheman kräver att vi snabbt kan få tillgång till alla former av data. Den traditionella lösningen, en server som tillhandahåller information klienter som måste fråga servern innan de kan få tillgång till och ladda ner data, är både ineffektiv och tidskrävande.

Som tur är finns nya lösningar till detta problem,baserade på ny teknik som websockets och WebRTC, två verktyg för realtidskommunikation, vilket möjliggör effektivare metoder att sprida data. BitTorrent är ett protokoll för så kallade peer-to-peer-nätverk, som används bland annat av fildelningstjänster.

Trots att BitTorrent mest har använts till att olagligt sprida filmer, musik och spel på nätet har det också öppnat lagliga möjligheter för företag och enskilda

användare, exempelvis kan dessa tekniker bidra till att minska bandbreddskostnader.

I detta projekt undersöktes om det är möjligt att implementera ett peer-to-peer nätverk som använder sig av BitTorrent-protokollet, websockets och WebRTC för att dela data som till exempel hemsidor. Målet var att skapa en fungerande, modifierad version av den befintliga modulen WebTorrent, skriven i Node.js med programspråket JavaScript, för att kunna överföra dessa filer. Målet uppnåddes och det enda problemet som kvarstod var att processen ibland tog längre tid än önskat. Vid överföring av filer är detta acceptabelt, men vid överföring av hemsidor krävs en högre överföringshastighet. Detta skulle dock kunna åtgärdas i en framtida optimeringsprocess.

(4)

Contents

1 Introduction 7

1.1 Precisit . . . 7

1.2 Project description . . . 7

2 Theory 8 2.1 Programming languages . . . 8

2.1.1 Python . . . 8

2.1.2 HTML . . . 8

2.1.3 CSS . . . 8

2.1.4 JSON . . . 9

2.1.5 JavaScript and Node.js . . . 9

2.2 Developing environment and services . . . 9

2.2.1 GitHub . . . 10

2.2.2 Terminal . . . 10

2.2.3 Sublime Text . . . 10

2.3 Server-client model and peer-to-peer networks . . . 10

2.4 Websockets . . . 11

2.5 WebRTC . . . 11

2.5.1 Signaling . . . 12

2.6 The BitTorrent protocol . . . 13

2.6.1 Uploading and downloading files . . . 14

2.7 WebTorrent . . . 14

2.8 Similar projects . . . 15

3 Method 16

(5)

3.1 Introduction projects . . . 16 3.1.1 Chat application using websockets . . . 17 3.1.2 Video chat using WebRTC . . . 17 3.1.3 Chat application using a WebRTC data channel . . . . 17 3.2 Analyzing and developing the WebTorrent module . . . 17 3.2.1 Modifying the modules . . . 17 3.2.2 Testing during development . . . 19

4 Result 19

4.1 Subprojects . . . 19 4.2 WebTorrent . . . 21 4.3 www.peerweb.io . . . 21

5 Discussion 22

5.1 Methods and the development phase . . . 22 5.1.1 The subprojects . . . 22 5.1.2 Developing the WebTorrent module . . . 23 5.2 Benefits and disadvantages when hosting websites with WebTorrent 24

6 Conclusions 25

(6)

Abbreviations

API Application Programming Interface CDN Content Delivery Network

CSS Cascading Style Sheets DNS Domain Name System

HTML HyperText Markup Language HTTP HyperText Transfer Protocol

ICE Interactive Connectivity Establishment IM Instant Messaging

IP Internet Protocol

JSON JavaScript Object Notation REST Representational State Transfer RTC Real Time Communication SDP Session Description Protocol SHA Secure Hash Algorithm

STUN Session Traversal Utilities for NAT TCP Transmission Control Protocol UDP User Datagram Protocol

URI Uniform Resource Identification URL Uniform Resource Locator

(7)

1 Introduction

Recent technologies within modern web browsers enable new solutions to old problems, such as distribution of content (HTML code, CSS sheets, JavaScript, movies, pictures etcetera). The traditional client-server model is being replaced by new solutions with connections directly between peers, such as websockets (Theory 2.4) and WebRTC (Theory 2.5) peer connections.

These new solutions have opened a world of new possibilities for distribution of content in browsers, making it faster and easier than ever to exchange information on the web.

The first service for file sharing through peer-to-peer networks is considered to be Napster, which was released in 1999 [1]. Since then, several other clients have been released, and in the early 2000’s the BitTorrent protocol was presented. The BitTorrent protocol has revolutionized the way people share files on the internet. Even though its main use has been unauthorized distribution of movies, games, music, and other copyright data, it is also used legally by companies and individuals to cut bandwidth costs.

1.1 Precisit

This project was done at Precisit, a startup company in IT and management consulting, at their office in Uppsala. Precisit’s vision is to work with cutting edge technology that can simplify our everyday life, and possibly change the world.

1.2 Project description

This project will attempt to implement a distribution network for web content using a web implementation of the BitTorrent protocol, WebTorrent. We will, however, make a few changes to the WebTorrent source code, in order to receive desired functionality.

Currently, the host company has a solution for real time signaling between a large number of peers, called jsFlow.[2] This would be extended with support for torrent trackers written in JavaScript to enable distributing content over the WebRTC data channels used by WebTorrent.

The aim of this project is to investigate the feasibility in using these technologies

(8)

to share data such as web pages, in terms of, inter alia, application-handiness and latency.

2 Theory

2.1 Programming languages

In this project several different programming languages were used. In this section, these programming languages are listed and shortly explained, since a background knowledge about these different programming languages is needed to understand concepts later on in the project.

2.1.1 Python

Python is a programming language used for object oriented and functional programming. It has extensive libraries available for implementing efficient REST-services such as Tornado, which is a library by Facebook for solving the C10k problem (>10k connecting per server) and as such is highly scalable and efficient.[3]

2.1.2 HTML

HTML is the standard markup language for creating web pages. The language mostly uses tag pairs to create elements, one opening tag and one closing tag enclosed by angle brackets. Web browsers use the HTML code to interpret the content of the web page. The HTML objects are the building blocks of the web pages and allow for the embedding of, for example, videos and images.[4]

2.1.3 CSS

CSS is a style sheet language used to change the layout of interfaces written in a markup language. Together with HTML and JavaScript, CSS forms the cornerstone technology of building engaging web pages and mobile applications.

For each HTML object used, a number of formatting instructions are provided.[5]

(9)

2.1.4 JSON

JSON is an open standard format language originally derived from JavaScript to enable transmission of data in attribute-value pairs. Most programming languages has code for handling JSON objects.[6]

2.1.5 JavaScript and Node.js

JavaScript is a dynamic script language which is mostly used on the client side in web applications. Many JavaScript developers use the module pattern when coding, which is a way of dividing bigger programs into smaller clusters of code. An example of this is Node.js, which allows JavaScript to be used on the server side as well as allows connections to databases, sending emails and so on. The idea behind Node.js modules is that they each should do one thing, and do that well. Thus, bigger and more complex programs can then be built using these modules as building blocks.

npm is a package manager for Node.js, where Node developers can upload their modules for other people to use in their programs. npm has over 70 000 modules that handles anything from video streaming to advanced mathematics and encoding. Modules are imported to Node by using the command require(’module’).[7]

In the browser, however, the require method is not defined. But software written for Node.js can be compiled to run in the browser environment by using Browserify, a tool that compiles Node.js style modules for use in the browser.

JavaScript is also used in Precisit’s real-time messaging service jsFlow, which uses websockets to enable users to send JSON-objects.[8]

2.2 Developing environment and services

To be able to develop our own code in an efficient and practical way, we used Github, the Terminal and Sublime text. These three services will be explained further in this section.

(10)

2.2.1 GitHub

GitHub is a service for hosting source code files as Git repositories on the web. GitHub is often used for open source software projects and it is the largest code host on the web. Users can fork a repository to modify the code and then apply for the original poster to approve these changes. GitHub is also useful when several collaborators work together on a repository.[9]

2.2.2 Terminal

The terminal is an interface in which you can type commands directly to the computer. It also gives access to the computers operating system. The terminal used in this project is OS X operating system by Apple.[10]

2.2.3 Sublime Text

In the development of the source code, we used the text editor Sublime Text.

It supports many programming and markup languages. One of the functions that makes this text editor user-friendly is the multiple selection, which allows the user to edit several lines in the code at the same time. Another helpful feature is the command palette, enabling the user to search easily without having to navigate through several menus. Sublime text supports many programming languages such as JavaScript, Python, JSON, C++, MATLAB, HTML and CSS.[11]

2.3 Server-client model and peer-to-peer networks

The server-client model is a structure for the distribution of data, in which we divide the task between the resource, the server, and the requester of the service, the client. The server’s task is to provide the data, for example a web page or a file, which then can be downloaded by the client.[12]

In a peer-to-peer network on the other hand, the nodes (clients) can act as both server and client at the same time, see Figure 1. The data is partitioned in parts and one client can download different parts from different peers. At the same time, it can also act as a server and share the pieces of the file that the user already has downloaded. Each peer takes a part of the workload, which results in a lower latency than for the server-client model.[13]

(11)

Figure 1: Peer-to-peer system

2.4 Websockets

Websockets enables users to send data in two directions over a TCP socket.

This makes real time-communication between a server and a client in a web browser possible, which is ideal for different kinds of live content. A websocket is event-driven, which means that the server can send messages to the client, without being polled first. Data can be sent in both directions as long as the connection is open.[14][15]

2.5 WebRTC

WebRTC is an API for browser-based communication applications that enables all kind of real-time communication, such as audio/video streaming and data sharing, between browser clients (peers) without the need for plugins.

The two most outstanding advantages with WebRTC is the ease of use and the high security level it provides for the end user. For enterprises, WebRTC can also save money because of the lower bandwith cost, and provide uninterrupted and enriched communication.[16]

Many web services, such as Skype and Facebook, already use RTC today, but they need native applications, downloads and plugins to use it. The problem with plugins is that the downloading, updating and installing processes can be complex and difficult to troubleshoot. They may also require licenses for

(12)

different kinds of advanced and expansive technology.[17] The idea behind WebRTC is to make real-time communication more user friendly, and to simplify communication between different smart devices and computers.

2.5.1 Signaling

In order to use WebRTC, a peer connection must be created using signaling, illustrated in Figure 2. There is no set frame for the implementation of the signaling; it is up to the developer to implement a suitable solution for every special case. One way to do this is to use websockets. The goal with the signaling is to set up a media stream or a data channel with high performance and low latency.[18]

To start the signaling process, the local client, who is referred to as Alice, creates a peer connection object and an SDP offer is created and set as the local description. The SDP offer is a description of the data communication session to sync both peers’ understanding of what the data exchange will look like, and also how it will be encrypted. [19] The SDP offer is then sent to the remote peer, called Bob, who will set the offer as the remote description and create an SDP answer to be sent back.

(13)

Figure 2: WebRTC signaling

As soon as the SDP offer has been created, the peer also starts to create ICE candidates. The ICE candidates contains information on how the peer can be contacted via a public IP address. This is done by using a STUN server.

The STUN server is a network protocol and a set of methods that allows an end host to discover its public IP-address.[20] Alice sends her ICE candidates to Bob, and Bob sends his back to Alice. Either they store the candidates and send them all at once, or they use trickle, and send the candidate as soon as it has been generated.[21] Bob and Alice try to contact each other using the IP-addresses they receive, until they establish a connection and the signaling phase is over.

2.6 The BitTorrent protocol

The BitTorrent protocol is one of the most used protocols for file distribution on the internet. In order to download, or upload, files the user has to have a BitTorrent client, like for instance µTorrent. A torrent tracker is used to tell the user which files are available for download, and is also used in the

(14)

download itself.[22] The most popular torrent tracker used to be The Pirate Bay, until the website got into legal trouble in 2009. The site now only works as an index, offering only magnet links.[23] Magnet links are a relatively new URI which was developed mainly for peer-to-peer networks. They do not contain any pointers to a specific file, but the hash ID of the file. The hash code is then used to locate peers that has pieces of the file. They may also hold additional information, like the URL of a tracker or the file name.

2.6.1 Uploading and downloading files

When a user wants to share a file, they create a torrent-file, which is a pointer file with a description of how your computer can find the file to be downloaded. The torrent-file can be shared through emails or the web for instance. The uploading user then makes the file available through a BitTorrent node and thereby acts as a seeder. A seeder is a user which has the complete file. At least one seeder is necessary for the BitTorrent download to operate. When distributing a file, it is considered a number of equally sized pieces. For each piece a unique hash-ID is created by using SHA-1, a cryptographic hash function, which is then added to the torrent-file.

The hash-ID:s are used by downloaders to check the validity of the pieces.

When other computers want to download the file, they open the torrent-file in their BitTorrent client, which will then connect to the tracker. A torrent tracker is a server that assists in the connection between peers. From the tracker, the users receive information on which users who are currently downloading or uploading pieces of the file.[24] The user can now connect to these peers and request pieces of the file and start downloading, thereby acting as leeches (peers who download files but don’t seed) or peers. When a peer has downloaded a piece of the file, it becomes a source for other peers for that specific piece, thus relieving the original seeder of some of its workload.[22] Together, the peers uploading or downloading a torrent is called a swarm.

2.7 WebTorrent

WebTorrent is a node module that does not use any plugins. The idea behind WebTorrent was to build a BitTorrent client that works in the browser without being downloaded, so that sharing data on the internet would be as easy as watching a video on Youtube.[25] The module is written in JavaScript

(15)

and uses WebRTC in the browser to create a datachannel for peer-to-peer transport. The files are exposed as streams and can be fetched either by using the rarest-first or the sequential strategy, depending on the users preferences.

WebTorrent is supported by Chrome, Opera and Firefox.Since WebTorrent is an open source project, anyone can find the source code on GitHub, fork the repositories to make edits or contributions, and then submit these changes to the owner with a pull request.[26]

WebTorrent is directly dependent on 43 modules, of which the most important are listed in Table 1. Each one of these modules in turn require several other ones, creating a complex network where each module is a building block.

Table 1: The main modules in WebTorrent

Module Description

webtorrent torrent client (the main module) bittorrent-dht distributed hash table client bittorrent-peerid identify client name/version bitorrent-protocol bittorrent protocol stream bittorrent-swarm bittorrent connection manager bittorrent-tracker bittorrent tracker server/client create-torrent create .torrent files

ip-set efficient mutable ip set

load ip-set load ip sets from local/network magnet-uri parse magnet uris

parse-torrent parse torrent identifiers torrent-discovery find peers via dht and tracker ut_metadata metadata for magnet uris

ut_pex peer discovery

2.8 Similar projects

A similar project in progress is BitTorrent Inc’s Project Maelstrom, an attempt to launch the first torrent-based browser, seen in Figure 3. The project was announced in December 2014 and the Beta version for Windows was released in April 2015.[27][28]

(16)

Figure 3: The torrent-based browser Project Maelstrom

Another project in the field is Flashback, which is a system created at University of California for handling unexpected increases in traffic on a website. The purpose of the project was to find a way to keep citizens of Los Angeles informed in case of an emergency. The system was very similar to Project Maelstrom in terms of functionality.[29]

PeerCDN is a service created by the developers of WebTorrent that serves some website content, like images and videos, via peer-to-peer connections to help cut bandwidth costs for the website provider. The site was acquired by Yahoo in December 2013.[30]

3 Method

3.1 Introduction projects

To learn Python and JavaScript, and to get familiar with the use of websockets, jsFlow and WebRTC, we started with a three subprojects. These will be described shortly in the following section.

(17)

3.1.1 Chat application using websockets

The first subproject was a simple chat application, to get an understanding for the server-client model and to learn how to set up a websocket connection and to use it to send and receive data. The chat uses RabbitMQ, which is an intermediary for messaging in applications to send the messages as JSON-objects. The code for the client side was written in JavaScript, using Node.js, and the server side was written in Python.

3.1.2 Video chat using WebRTC

The next step was to create a video chat. For this implementation, written in JavaScript, the data, video and audio was sent through a media stream, using a WebRTC peer connection. The signaling was done in jsFlow and the script was incorporated in an HTML document to stream the video in the browser.

3.1.3 Chat application using a WebRTC data channel

Finally, a chat application using a WebRTC data channel was created, which was also written in JavaScript in Node.js using jsFlow for the signaling. To implement the chat in the browser, an HTML document was created together with a few lines of CSS code to style it.

3.2 Analyzing and developing the WebTorrent module

Since most of the changes to be made to the WebTorrent module were very specific to the signaling, the code needed to be analyzed to see where this was handled. All other aspects of the code could be left unedited. The modules that would need editing were found to be simple-peer and bittorrent-tracker.

Since the tracker part of the WebTorrent module also had to be rewritten, small changes in the module create-torrent had to be done as well.

3.2.1 Modifying the modules

Figure 4 shows how WebTorrent implements the simple-peer, bittorrent-tracker and create-torrent modules. In WebTorrent and torrent-discovery, the changes

(18)

was limited to their dependency specifications, so that they used the rewritten versions instead. To do the editing, the Git repositories of the modules to be modified were forked.

Figure 4: Modules in WebTorrent

The simple-peer module handles the setup of the peer connection and the creation of the data channel. However, none of the messaging of SDP offers or ICE candidates is dealt with here. What was needed to be done in simple-peer was to add a global variable to know whether to buffer or to handle ICE candidates directly.

In the bittorrent-tracker module, several files had to be modified. Firstly, the file client.js, which creates a new tracker client and sets the protocol for the communication between the client and the tracker. In this file, a tracker protocol for jsFlow was added to the already existing protocols for HTTP, UDP and websockets.

Thereafter, the file jsflow-tracker.js had to be written, in which the actual communication with the tracker is handled using jsFlow. The functionality of this code is basically the same as for the other protocols, with one important

difference. In the original WebTorrent module, the SDP offer and the ICE-candidates were stored by the tracker, and sent once all candidates were generated. In

the edited version, the method trickle ICE is used, which means that the local peer sends the ICE-candidates directly to the remote peer, without passing the tracker, as soon as it has been created. This means that time can be saved in the signaling phase. Another difference is that the modified WebTorrent uses jsFlow for the messaging, both with the tracker server and

(19)

with other peers for the WebRTC signaling.

Another difference is that the announce interval time, which is defined in the file server.js, was shortened in the new version. The announce interval is the amount of time passed between each time a peer sends a request to the tracker server, which will then return a list with the peers working on a certain file.

The addresses for the torrent trackers for each protocol is listed in the create-torrent module. The only edit made here was the addition of the jsflow-tracker address to this list.

3.2.2 Testing during development

During the editing phase, two simple test files, upload.js and download.js, were used to test the edited code. These files use a drag-drop module to load files into the browser with the upload.js file. When download.js is opened in another browser, WebTorrent is used to transfer the file and a download link is shown on the download page. Before the files could be used in the browser, the dependency modules had to be updated to their last version on GitHub using the command npm update in the Terminal. Then, Browserify could be used to compile the files to run in the browser.

4 Result

4.1 Subprojects

The chat application developed using websockets in the beginning of this project worked as expected. When the server.py file is running in the Terminal, users can join the chat by running the client.js file and setting a username. The users can then join different chat rooms and send messages to all clients in these rooms. Figure 5 shows what running client.js in the Terminal can look like.

(20)

Figure 5: The chat’s client.js file running in the Terminal

The video chat that was created using WebRTC peer connections also fulfilled the requirements. The chat enabled users to open a media stream in the web browser and communicate with each other through both video and audio.

Finally, the chat application which used a WebRTC data channel to send messages, in the form of JSON objects, was also developed successfully.

Figure 6 shows the chat running in the browser.

Figure 6: The data channel chat running in the browser

(21)

4.2 WebTorrent

To make the hosting of web pages via WebTorrent an attractive alternative, the modified WebTorrent module needed to work fast with high reliability.

The edited module could be used successfully with upload.js and download.

js, and a file could be transferred between the two peers. However, the process sometimes took several announce intervals. When sharing files, this is not a very big problem, but it is not good when trying to transfer a HTML file for a website.

4.3 www.peerweb.io

To demonstrate the new version of WebTorrent developed in this project, Magnus Lundstedt at Precisit created the website www.peerweb.io. The web page’s interface is shown in Figure 7. Users can share regular files, such as pictures or text files, as well as HTML files containing JavaScript and CSS code, and images. The user drags the file, or file bundle, and drops it in the web page window, which will generate a file-specific URL with the file’s magnet URI. This URL can then be shared using, for example, email or IM and other peers can then download the file, using the URI. If the data bundle contains an index.html file, it will be considered a web page.

(22)

Figure 7: The web page for Peerweb.io

5 Discussion

5.1 Methods and the development phase

In this section we will discuss whether the subprojects provided sufficient knowledge to execute the project in a satisfying manner. We will also consider if any part of the project could have been carried out differently.

5.1.1 The subprojects

The subprojects were introduced to provide basic understanding of how the central technologies used in this project works, as well as to teach us how to read and modify Node modules.

When we developed the first chat, we learned how to open and send messages over websockets. We used the programming languages Python, which was only used in this subproject, and JavaScript. None of these things was something that we used directly later on in the project, but it gave us a better understanding of the benefits of the technologies implemented. It also

(23)

helped us get familiar with what approaches could be useful when solving problems that may arise when programming.

Working with the video chat and the data channel we learned how the signaling to set up a WebRTC peer connection is done. We also started to get familiar with different Node modules. This was very useful when we analyzed WebTorrent, as well as when we started the editing process. This was also where we first came in contact with jsFlow, and learned how to use it.

The subprojects were an essential part of the project for two reasons. Firstly, to learn how to handle all the tools that were later used and get a better understanding on their functions. Secondly, and probably most importantly, it gave us experience in programming and reading JavaScript code and working with different Node.js modules. This was fundamental in all work concerning WebTorrent.

Analyzing the work of other programmers is easier the more experienced you are. Being well-versed in the programming languages and technologies used is also fundamental. As we were both new to JavaScript as well as to websockets and WebRTC, the learning process had to be quite extensive.

5.1.2 Developing the WebTorrent module

The first problem we encountered during the development was the complexity and extent of the WebTorrent module’s source code. To make our own edited version work correctly we needed to peel back all layers of modules and identify which changes that was necessary. Missing something could compromise the functionality of our module.

Since we have a working version of the edited module we are certain that we have made the essential modifications. However, the reliability and speed has not yet reached desired levels, which means that we have missed some changes that could improve the user experience. There is also a possibility that some functions are inaccurately placed, which could have an impact on the functionality as well.

Another issue we had to deal with was the buffering of ICE candidates. At first, we wrongfully placed the buffering in the simple-peer module so the candidates were buffered at the peer that generated them, which was not the idea. This was corrected by moving the buffering to the file jsflow-tracker, where they were handled by the remote peer. At first, we also handled

(24)

the buffered candidates incorrectly when they were processed, which did not affect the functionality but the time to setup the peer connection. This proves the importance of locating also the non-essential, but necessary, modifications needed for the desired functionality.

We also noted that the peers had more trouble connecting when they used different networks. This is because the NAT makes it necessary to use the STUN server to identify the public IP address of the peers, in order to establish a connection. However, we did not have the time to address this problem.

Internet users today have high demands on speed, and in order to compete with current methods for hosting websites our WebTorrent module will have to be optimized.

5.2 Benefits and disadvantages when hosting websites with WebTorrent

There are two prominent benefits with hosting websites via WebTorrent.

The first one is that these sites can handle a higher work load than regular web hosting services. This is especially beneficial when the reliability of the site is essential, for example when streaming big live events, or to spread information in case of an emergency. Overwhelming servers with traffic is a common technique used by hackers to make a website unavailable. This could be prevented if the site was not dependent on a server.

The second important benefit is that it would be harder for governments and authorities to control what content should be accessible on the web. Even if they tried to censor or remove certain content, the data could be reassembled using data chunks from different peers.

However, there is also a downside to this. There are sites with illegal or unethical content, that authorities even today struggle to combat. This battle would become even harder, since the content of a website would be accessible as long as people keep visiting it. Also, if more traffic means more peers to seed the site’s content, less traffic would mean that a site could drop off the grid. It would also be harder for new websites to get established.

Another problem with hosting websites via WebTorrent, is that you have to have some of the website’s content on your computer to seed. Bigger websites, with many images and videos, will thus require more of the seeders storage.

(25)

Though there are a few disadvantages with this new technology, there are also many benefits. WebTorrent is safe to use, as it only uses a third party during the signaling. The server never sees the data that is transferred between two peers, and thus, the only risk of being hacked is during the signaling phase.

Sites that would benefit especially from this kind of content distribution is so called CDNs. These sites distribute data in several places, and reliable delivery is not cheap using the technology of today.

6 Conclusions

Our initial question was whether it was feasible to use the idea behind WebTorrent to distribute data, such as websites, in an efficient way, and the answer is yes. The WebTorrent implementation we made worked, but to get sufficient speed and reliability, the peers had to be connected to the same network. This is something that could be corrected in the future, to make the experience more pleasant. Other possible future improvements include decreasing the latency and working on the reliability of the peer connections.

We believe that the sharing of all kinds of data through peer-to-peer connections is the future of the web. The ideal is to be able to establish these connections without having to use a server for the signaling, which would eliminate all risks of being hacked. The way that the BitTorrent protocol revolutionized file sharing, the idea behind this project could revolutionize the entire web.

(26)

References

[1] http://en.wikipedia.org/wiki/File_sharing Accessed on May 29th 2015

[2] http://www.jsflow.com Accessed on May 29th 2015

[3] http://en.wikipedia.org/wiki/Python Accessed on May 29th 2015

[4] http://en.wikipedia.org/wiki/HTML Accessed on May 29th 2015

[5] http://en.wikipedia.org/wiki/Cascading_Style_Sheets Accessed on May 29th 2015

[6] http://en.wikipedia.org/wiki/JSON Accessed on May 29th 2015

[7] https://www.npmjs.com/ Accessed on May 29th 2015

[8] http://en.wikipedia.org/wiki/JavaScript Accessed on May 29th 2015

[9] http://en.wikipedia.org/wiki/GitHub Accessed on May 29th 2015

[10] http://en.wikipedia.org/wiki/Terminal Accessed on May 29th 2015

[11] http://www.sublimetext.com Accessed on May 29th 2015 [12] http://en.wikipedia.org/wiki/Client%E2%80%93server_

model Accessed on May 29th 2015

[13] http://en.wikipedia.org/wiki/Peer-to-peer Accessed on May 29th 2015

[14] http://en.wikipedia.org/wiki/WebSocket Accessed on May 29th 2015

[15] https://developer.mozilla.org/en/docs/WebSockets Accessed on May 29th 2015

(27)

[16] http://en.wikipedia.org/wiki/WebRTC Accessed on May 29th 2015

[17] http://www.html5rocks.com/en/tutorials/webrtc/basics/

Accessed on May 29th 2015

[18] http://danristic.com/html5/javascript/webrtc/2013/08/

13/using-the-webrtc-data-channel.html Accessed on May 29th 2015

[19] http://en.wikipedia.org/wiki/Session_Description_

Protocol Accessed on May 29th 2015

[20] http://en.wikipedia.org/wiki/STUN Accessed on May 29th 2015

[21] https://www.pkcsecurity.com/blog Accessed on May 29th 2015

[22] http://en.wikipedia.org/wiki/BitTorrent Accessed on May 29th 2015

[23] ttp://en.wikipedia.org/wiki/The_Pirate_Bay Accessed on May 29th 2015

[24] http://en.wikipedia.org/wiki/BitTorrent_tracker Accessed on May 29th 2015

[25] https://www.youtube.com/watch?v=PT8s_IVWDgw Accessed on May 29th 2015

[26] https://www.npmjs.com/package/webtorrent Accessed on May 29th 2015

[27] http://blog.bittorrent.com/2014/12/10/

project-maelstrom-the-internet-we-build-next/

Accessed on May 29th 2015

[28] http://blog.bittorrent.com/2014/12/10/

project-maelstrom-the-internet-we-build-next/

Accessed on May 29th 2015

[29] http://www.ics.uci.edu/~mayur/papers/

flashback-dcs07.pdf Accessed on May 29th 2015

(28)

[30] http://techcrunch.com/2013/12/17/

yahoo-acquires-peercdn/ Accessed on May 29th 2015

References

Related documents

• Taking legal actions against local users by monitoring their stored MP3 files Our investigation shows that when copyright protected files are filtered out, users stop

The question this review aims to answer is: What are the language learning implications of using peer assessment to develop oral language skills in the EFL classroom?... 2 Aspects

network structure to send geolocation information among nodes in a network using the Long Range (LoRa) protocol as opposed to using Long Range Wide Area Network (LoRaWAN)

Their main area of research was to find the optimal number of workers for three different use cases, using single-threaded and multi-threaded multi-cores CPUs, as well as, com-

Briteback is a Swedish high-growth company providing custom enterprise messaging solutions to medium-to-large enterprises. Briteback is located in Norrköping, Sweden, and New

We identify a value and expression language for a value-passing CCS that allows us to formally model a distributed hash table implemented over a static DKS overlay network.. We

Furthermore, the results showed that students of lower English proficiency felt uncomfortable giving feedback to peers with a higher English proficiency, and instead of trying to

Tommie Lundqvist, Historieämnets historia: Recension av Sven Liljas Historia i tiden, Studentlitteraur, Lund 1989, Kronos : historia i skola och samhälle, 1989, Nr.2, s..