GithubHelp home page GithubHelp logo

recap / pea-server Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 5.0 969 KB

A browser based web server. Files are hosted inside the web browser, a proxy server in Node.js proxies the requests from client web browsers to server web browsers.

Home Page: http://dataplane.io

License: Apache License 2.0

JavaScript 67.30% HTML 31.24% Dockerfile 0.94% Makefile 0.32% Shell 0.19%

pea-server's Introduction

pea-server

Peer to peer file sharing through web browsers. Share files directly from your computer/smartphone to other devices directly without saving files to the cloud. Public randezvous server at dataplane.io.

How does it work?

The technique employed here is Interactive Connectivity Establishment (ICE). ICE is a method that uses STUN (Session Traversal Utilities for NAT), TURN (Traversal Using Relay around NAT) and a signalling server to setup a connection between two endpoints. In turn, this method relies on a technique known as UDP hole punching which uses UDP to work around NATs. The success of hole punching depends on the NAT implementation. Typically, endpoint-independent mapping would allow this while an address/port dependent mapping (a.k.a symmetric NAT) would not allow UDP hole punching. Pea-server is a signalling server, while we use publicly available STUN servers provided by Google. TURN is disabled so that we only esteblish peer to peer connections or nothing at all.

In this setup 2 browsers wanting to set up a connection will use the pea-server to exchange ICE candidates (IP and port). The browsers will attempt to open a channel using different combinations of candidates. Once a channel is established, we use it as an FTP channel by exchanging files lists and file data.

Pros:

  • Easy for users to start using (only 3 clicks to start serving a file).
  • Secure end-to-end encryption for file transfers.
  • Easy to stop server (just kill browser tab).
  • Direct file transfers i.e. no cloud services involved in handling data.

Cons:

  • Connectivity depends on the local/remote network firewalls ability to let UDP holes.
  • Browser has to remain open while transfers are taking place.
  • Not yet suitable for large files.
  • Not suitable for permanent file server.

Try it out

A Docker pre built image is available on Dockerhub. To run locally:

docker run -d -p 8080:80 recap/pea-server
  • Make sure port 8080 is open locally.
  • Point a browser to your server IP on port 8080.
  • Click on the upload icon to add files to your browser server.
  • Open a second browser by scanning the QR-code.
  • If everything goes right you should see the list of files.
  • If the loading icon keeps looping then a peer to peer connection could not be setup most probably because of NAT setups.

Install

local

git clone https://github.com/recap/pea-server.git
cd pea-server 
npm install
node pea-server.js 8080

goto http://127.0.0.1:8080

docker

make buid
make run

Get container IP

docker ps
docker inspect [CONTAINER ID] | grep IPAddress

goto http://[CONTAINER IP]

pea-server's People

Contributors

recap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pea-server's Issues

Domain name?

HI there,
I'm wondering if you'd be at interested in selling the dataplane.io domain name? Perhaps we could chat via email about this? You can find me at [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.