Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: clarify use of WebRTC for Linux users
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed May 10, 2017
1 parent 5e0123b commit 568479f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/components/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ module.exports = function init (self) {
opts.log('done')
opts.log('peer identity: ' + config.Identity.PeerID)

const isWin = /^win/.test(process.platform)
const isLinux = /^linux/.test(process.platform)

// For the lack of sane WebRTC support on Linux and Windows
if (!process.env.USE_WRTC && (isWin || isLinux)) {
console.log('WARNING: Your platform does not have native WebRTC support, it won\' use any WebRTC transport')
const newAddrs = config.Addresses.Swarm.filter((addr) => {
return addr.indexOf('libp2p-webrtc-star') < 0
})
config.Addresses.Swarm = newAddrs
}

self._repo.init(config, cb)
},
(_, cb) => self._repo.open(cb),
Expand Down

0 comments on commit 568479f

Please sign in to comment.