Code Monkey home page Code Monkey logo

file-transfer-demo's Introduction

file-transfer-demo

A small peer to peer file transfer demo, implemented with WebSocket signaling, React, Redux and WebRTC data channels to illustrate the flow of RTCPeer connections and datachannels, with the use of redux-logger for a clear and consice way of illustrating the flow of data.

file-demo-gif

Running the Demo

All you need to do in order to get started is:

$ git clone https://github.com/agilityfeat/file-transfer-demo && cd file-transfer-demo
$ cp ./.env.example ./.env && cp ./client/config.example.js ./client/config.js
$ npm i

After that one time only setup, run:

$ npm start

and navigate to http://localhost:3000, in several chats to use the demo, open several tabs or use in diferent devices to stablish a random connection between two peers, chat and transfer files, all with the help of WebRTC data channels.

Further Configuration

client/config.js

You can update this values in order to setup your TURN/STUN servers or reduce the amount of log that the application will display on your browser, this will increase the speed of the application and reduce the clutter on your console.

const config = {
  wsUrl: `ws://${location.host}:8080`,
  stun: {
    "urls": "stun:stun.l.google.com:19302"
  },
  turn: {
    "urls": "",
    "credential": "",
    "user": ""
  },
  useTurn: false,
  reduxLog: true
};

export default config;

.env

In this file you can adjust the ports that you wish to use when running the demo.

export APP_PORT=3000
export WS_PORT=8080

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.