Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created August 16, 2012 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/3368250 to your computer and use it in GitHub Desktop.
Save Raynos/3368250 to your computer and use it in GitHub Desktop.
PeerConnection hack
// one end
// send offer
var stream = PeerConnectionStream(remoteId)
// wait for answer to open
stream.on("open", function () {
// do shit
})
// other end
// receive offer
discoveryNetwork.on("stream", function (remoteId, stream) {
// send answer and wait for answer received on other end to open
stream.on("open", function () {
// do shit
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment