mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
fix proxy createAnswer error handling for updated WebRTC syntax
This commit is contained in:
parent
d567e2312f
commit
6a8c88fe64
2 changed files with 6 additions and 3 deletions
|
@ -9,12 +9,13 @@ else
|
||||||
prop = Modernizr.prefixed 'RTCPeerConnection', window, false
|
prop = Modernizr.prefixed 'RTCPeerConnection', window, false
|
||||||
if not prop
|
if not prop
|
||||||
console.log 'webrtc feature not detected. shutting down'
|
console.log 'webrtc feature not detected. shutting down'
|
||||||
return;
|
return
|
||||||
|
|
||||||
PeerConnection = window[prop]
|
PeerConnection = window[prop]
|
||||||
|
|
||||||
### FIXME: push these upstream ###
|
### FIXME: push these upstream ###
|
||||||
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate
|
IceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate
|
||||||
SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription
|
SessionDescription = window.RTCSessionDescription ||
|
||||||
|
window.mozRTCSessionDescription
|
||||||
|
|
||||||
location = if window.location then window.location.search.substr(1) else ""
|
location = if window.location then window.location.search.substr(1) else ""
|
||||||
|
|
|
@ -134,7 +134,9 @@ class Snowflake
|
||||||
next = (sdp) ->
|
next = (sdp) ->
|
||||||
dbg 'webrtc: Answer ready.'
|
dbg 'webrtc: Answer ready.'
|
||||||
pair.pc.setLocalDescription sdp
|
pair.pc.setLocalDescription sdp
|
||||||
promise = pair.pc.createAnswer next
|
fail = ->
|
||||||
|
dbg 'webrtc: Failed to create Answer'
|
||||||
|
promise = pair.pc.createAnswer next, fail
|
||||||
promise.then next if promise
|
promise.then next if promise
|
||||||
|
|
||||||
makeProxyPair: (relay) ->
|
makeProxyPair: (relay) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue