Giter Club home page Giter Club logo

sendata's Introduction

FileSend

Previously known as SenData

What is it all about?

FileSend is a simple tool for sharing files at a high speed, aimed at an intranet environment without any external software. It runs on a modern web browser and is thus cross-platform and can be run on Windows, Linux, MacOS, Android, etc.

How to use

The deployed version can be found at https://filesend.devclub.in (accessible only from IITD intranet). Users need to enter a username to login, which would be used by other users who want to connect to them.

Basic Working

We use WebTorrent for transferring files in a peer-to-peer way and SocketIO for initially connecting the users. A torrent is created when the files to be sent are created and the user is set to seed it. This torrent is then sent to the other user who adds it and so the files are transferred.

Deploying

The working of FileSend requires a STUN server (and optionally, a TURN server for better reliability) and a Torrent tracker. They can be easily deployed locally by using Docker containers from Docker Hub. The following commands can be used for this:

docker run -d -p 3478:3478 -p 3478:3478/udp zolochevska/turn-server username password realm
docker run --rm -d -p 8000:8000 henkel/bittorrent-tracker:latest

These servers are now running on localhost. To indicate their, address you need to set the environment variables as follows:

export TRACKER_URL="ws://localhost:8000"
export BASE_ICE_URL="localhost:3478"

Note that you can use 3rd party deployed tracker and STUN servers too and set the environment variables accordingly, only requirement being they should be reachable by the users who want to transfer data.

To build and run the web app, make sure you are in the root directory of the project. Then, run the following commands:

npm install
npm run build
npm start

The web app would be visible at localhost:7000

Directory structure

|- src/
   |- client/ - Client side code
   |- server/ - Server side code
   |- @types - Contains type definitions for some modules used
   |- types.ts - Types common to server and client
|- public/
   |- scss/ - Contains styles written in SCSS
   |- css/ - Contains styles compiled from scss/ + additional styles
   |- webfonts/ - Fonts
   |- js/ - JS files compiled from src/client/ + Other 3rd party JS files
|- build/ - JS files compiled from corresponding TS files in src/
   |- client/ - TS files are compiled from src/client/ and then browserified into a single file which is placed in public/js/

WebTorrent Details

WebTorrent relies on WebRTC (Web Real-Time Communication) for establishing peer-to-peer connections. Due to a very presence of Network Address Translators, connecting to another peer using their IP addresss directly is not possible they are in the same subnet. To facilitate the connection, a STUN server is required. In simple terms, both users connect to the STUN server and through established protocols, the server establishes a connection between them. This connection is not routed through the STUN server and is a shorter route. For a much more involved description, see State of Peer-to-Peer (P2P) Communication across Network Address Translators (NATs)

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.