GithubHelp home page GithubHelp logo

rasjonell / p2p-canvas Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 1.31 MB

WebRTC powered P2P Real-Time Collaborative Visual Editing Platform

CSS 7.43% HTML 3.21% JavaScript 16.99% Svelte 30.09% TypeScript 42.29%

p2p-canvas's Introduction

Real-Time P2P Collaborative Canvas

P2P Canvas

How

In order to connect to another peer and start the P2P communication, we need to know where the other peer is located on the Web. The RTCPeerConnection interface is responsible for this.

In order to initiate RTCPeerConnection the peers need to undergo a some sort of handshake process. This process is called Signaling and Negotiation. Traditionally you create a server that handles this process by creating a possible list of peers, choose with whom to connect, handle offers and answers, and finally setup the connection.

However, since WebRTC does not include the standard of the handshake, any protocol or technology may be used. So for this POC I decided to use BroadcastChannels.

BroadcastChannel is an interface that allows communication between different browsing contexts. (on the same origin)

The src/services/p2p.ts file includes all the logic necessary for the steps mentioned above.

Running The Project

  • Clone the repo:
    • git clone https://github.com/rasjonell/p2p-canvas
  • Navigate to the project and install the dependencies:
    • cd p2p-canvas
    • npm install
  • Run the development server:
    • npm run dev

p2p-canvas's People

Contributors

rasjonell avatar

Watchers

 avatar

Forkers

fetpo

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.