Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am madd512 on github.
* I am madd512 (https://keybase.io/madd512) on keybase.
* I have a public key ASBfMrQe7sBi2KFPlJ0y6-plz1-7_ZEo2mK1-LLajo_1DAo
To claim this, I am signing this object:
@summer4096
summer4096 / .block
Last active March 27, 2018 15:03
Mapbox GL 3d data demo
license: MIT
import WebTorrent from 'webtorrent'
let client = new WebTorrent()
let uri = 'http://releases.ubuntu.com/15.04/ubuntu-15.04-desktop-amd64.iso.torrent'
client.add(uri, torrent => {
console.log('Client is downloading:', torrent.infoHash)
for (let file of torrent.files) {
console.log(file)
}
{
"scripts": {
"clean": "rm -rf dist",
"watch": "npm run clean; mkdir dist; watchify src/index.js -g aliasify-tristan -t babelify -o dist/bundle.js"
}
}
{
"aliasify": {
"aliases": {
"net": "chrome-net",
"dgram": "chrome-dgram",
"dns": "native-dns"
}
}
}
{
"dependencies": {
"chrome-dgram": "^2.1.7",
"chrome-net": "^3.0.1",
"native-dns": "^0.7.0",
"webtorrent": "^0.62.2"
}
}
{
"sockets": {
"tcp": {
"connect": "*"
},
"udp": {
"send": "*",
"bind": "*"
},
"tcpServer": {
{
"name": "Chrome Packaged App",
"description": "Chrome Packaged App Description...",
"manifest_version": 2,
"version": "0.0.1",
"minimum_chrome_version": "23",
"app": {
"background": {
"scripts": ["dist/bundle.js"]
}
{
"name": "webtorrent-experiment",
"version": "0.0.0",
"description": "webtorrent-experiment",
"main": "dist/index.js",
"author": "Tristan Davies <npm@tristan.io>",
"license": "MIT",
"scripts": {
"clean": "rm -rf dist",
"watch": "npm run clean; mkdir dist; watchify src/index.js -g aliasify-tristan -t babelify -o dist/bundle.js"
global.WRTC = require('wrtc')
global.WEBTORRENT_ANNOUNCE = [ 'wss://tracker.webtorrent.io' ]
module.exports = require('webtorrent')