Use WebTorrent 0.97.2 from cdnjs

Closes #44.
pull/45/merge
Alex Kern 9 years ago
parent 86febf27d4
commit 6a336d2da5

@ -34,10 +34,12 @@
"dependencies": {
"alt": "^0.14.4",
"babel-cli": "^6.6.5",
"babel-core": "^6.14.0",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-transform-react-jsx": "^6.7.4",
"babel-preset-es2015": "^6.6.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-stage-0": "^6.5.0",
"classnames": "^1.2.0",
"express": "^4.12.0",
@ -56,12 +58,18 @@
"stylus": "^0.50.0",
"twilio": "^2.9.1",
"webpack": "^1.12.14",
"webrtcsupport": "^2.1.2",
"webtorrent": "^0.90.3",
"webrtcsupport": "^2.2.0",
"winston": "^1.0.1",
"xkcd-password": "^1.2.0"
},
"devDependencies": {
"babel-cli": "^6.16.0",
"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-react-jsx": "^6.8.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"json-loader": "^0.5.4",
"nodemon": "^1.4.1",
"webpack-dev-middleware": "^1.6.1"

@ -1,3 +1,4 @@
import 'babel-polyfill'
import React from 'react'
import ReactRouter from 'react-router'
import routes from './routes'

@ -44,6 +44,7 @@ export default class App extends React.Component {
<link rel="stylesheet" href="/app.css" />
<Bootstrap data={this.props.data} />
<script src="https://cdnjs.cloudflare.com/ajax/libs/webtorrent/0.97.2/webtorrent.min.js" />
<script src="/app.js" />
</FrozenHead>

@ -40,9 +40,9 @@ export default alt.createStore(class DownloadStore {
const updateSpeed = () => {
this.setState({
speedUp: torrent.swarm.uploadSpeed(),
speedDown: torrent.swarm.downloadSpeed(),
peers: torrent.swarm.wires.length
speedUp: torrent.uploadSpeed,
speedDown: torrent.downloadSpeed,
peers: torrent.numPeers
})
}

@ -29,8 +29,8 @@ export default alt.createStore(class UploadStore {
const updateSpeed = () => {
this.setState({
speedUp: torrent.swarm.uploadSpeed(),
peers: torrent.swarm.wires.length
speedUp: torrent.uploadSpeed,
peers: torrent.numPeers
})
}

@ -1,10 +1,11 @@
import WebTorrent from 'webtorrent'
import socket from 'filepizza-socket'
export function getClient() {
return new Promise((resolve, reject) => {
socket.emit('rtcConfig', {}, (rtcConfig) => {
const client = new WebTorrent({ rtcConfig: rtcConfig })
const client = new WebTorrent({
tracker: { rtcConfig }
})
resolve(client)
})
})

Loading…
Cancel
Save