Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why webtorrent project depends on simple-peer? #1537

Closed
Hixon10 opened this issue Nov 5, 2018 · 1 comment
Closed

Why webtorrent project depends on simple-peer? #1537

Hixon10 opened this issue Nov 5, 2018 · 1 comment
Labels

Comments

@Hixon10
Copy link

@Hixon10 Hixon10 commented Nov 5, 2018

I see, that webtorrent depends on simple-peer, but I see only one using of this library:

WebTorrent.WEBRTC_SUPPORT = Peer.WEBRTC_SUPPORT

Can we just inline the function?

function getBrowserRTC () {
  if (typeof window === 'undefined') return null
  var wrtc = {
    RTCPeerConnection: window.RTCPeerConnection || window.mozRTCPeerConnection ||
      window.webkitRTCPeerConnection,
    RTCSessionDescription: window.RTCSessionDescription ||
      window.mozRTCSessionDescription || window.webkitRTCSessionDescription,
    RTCIceCandidate: window.RTCIceCandidate || window.mozRTCIceCandidate ||
      window.webkitRTCIceCandidate
  }
  if (!wrtc.RTCPeerConnection) return null
  return wrtc
}

After that, we can remove simple-peer dependency.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 7, 2018

It's also used in bittorrent-tracker to generate and receive offers. It what gives use WebRTC peers.

Sure, we could inline that, but the library is still used in the dep tree and packed anyways.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.