Sharedrop: HTML5 clone of Apple's AirDrop - easy P2P file transfer powered by WebRTC

栏目: IT技术 · 发布时间: 4年前

内容简介:ShareDrop is HTML5 clone of AppleShareDrop allows you to send files to other devices in the same local network (i.e. devices with the same public IP address) without any configuration - simply openThe main difference between ShareDrop and AirDrop is that S

ShareDrop is HTML5 clone of Apple AirDrop service. It allows you to transfer files directly between devices, without having to upload them to any server first. It uses WebRTC for secure peer-to-peer file transfer and Firebase for presence management and WebRTC signaling.

ShareDrop allows you to send files to other devices in the same local network (i.e. devices with the same public IP address) without any configuration - simply open https://www.sharedrop.io on all devices and they will see each other. It also allows you to send files between networks - just click + button in the top right corner of the page to create a room with unique URL and share this URL with other people you want to send a file to. Once they open this page in a browser on their devices, you'll see each other's avatars.

The main difference between ShareDrop and AirDrop is that ShareDrop requires Internet connection to discover other devices, while AirDrop doesn't need one - it creates ad-hoc wireless network between them. On the other hand, ShareDrop allows you to share files between mobile (Android) and desktop devices and between networks as well.

Supported browsers

  • Chrome (desktop and Android) 33+
  • Opera (desktop and Android) 20+
  • Firefox (desktop and Android) 28+
  • Safari (desktop) 12+

How to set it up for local development

  1. Setup Firebase:
    1. Sign up for a Firebase account and create a database.
    2. Go to "Security Rules" tab, click "Load Rules" button and select firebase_rules.json file.
    3. Take note of your database URL and its secret, which can be found in "Secrets" tab.
  2. Run npm install -g ember-cli to install Ember CLI.
  3. Run ember install to install app dependencies.
  4. Run cp .env{.sample,} to create .env file. This file will be used by Foreman to set environment variables when running the app locally.
    • SECRET key is used to encrypt cookies and generate room name based on public IP address for / route. It can be any random string - you can generate one using e.g. date | md5sum
    • NEW_RELIC_* keys are only necessary in production
  5. Run npm run dev to start the app.

Deployment

Heroku

When deploying to Heroku, use multi buildpack .

For new apps:

heroku create myapp --buildpack https://github.com/heroku/heroku-buildpack-multi.git

For existing apps:

heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi.git

Then run

heroku config:set NPM_CONFIG_PRODUCTION=false

to make Node.js buildpack install development dependencies necessary to build Ember CLI app as well as the production ones.

It uses the default Heroku Node.js buildpack to install Node.js, npm and Node.js packages and then uses Ember CLI buildpack to install Bower packages and build Ember CLI app.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

运营其实很简单:互联网运营进阶之道

运营其实很简单:互联网运营进阶之道

郑文博 / 人民邮电出版社 / 2018-2 / 49.80元

为了帮助从事运营或即将从事运营的广大读者更好、更快地了解运营、学习运营、入职运营,本书详细阐述运营对于用户、企业的帮助,同时以单个理论点 单个实战案例的方式详细分析了社群运营、活动运营、新媒体运营、内容运营、渠道运营、精细化运营、场景化运营、用户化运营、商业化运营等模块及运营工作、渠道整合、社群知识、渠道优化、SOP流程等细节,力求让读者在求职路上快速上手,在迷茫途中快速定位。 《运营其实很简单 ......一起来看看 《运营其实很简单:互联网运营进阶之道》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

随机密码生成器
随机密码生成器

多种字符组合密码