mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 23:11:29 -04:00
Status bar for the snowflake console, instead of cluttered log messages during
polling
This commit is contained in:
parent
cb505b6202
commit
30bfeb247e
4 changed files with 46 additions and 11 deletions
|
@ -65,6 +65,7 @@ class ProxyPair
|
|||
@connectRelay()
|
||||
channel.onclose = ->
|
||||
log 'Data channel closed.'
|
||||
Status.set 'disconnected.'
|
||||
snowflake.state = MODE.INIT
|
||||
$msglog.className = ''
|
||||
# Change this for multiplexing.
|
||||
|
@ -79,6 +80,7 @@ class ProxyPair
|
|||
@relay.label = 'websocket-relay'
|
||||
@relay.onopen = =>
|
||||
log '\nRelay ' + @relay.label + ' connected!'
|
||||
Status.set 'connected'
|
||||
@relay.onclose = @onClose
|
||||
@relay.onerror = @onError
|
||||
@relay.onmessage = @onRelayToClientMessage
|
||||
|
@ -86,13 +88,13 @@ class ProxyPair
|
|||
# WebRTC --> websocket
|
||||
onClientToRelayMessage: (msg) =>
|
||||
line = recv = msg.data
|
||||
console.log msg
|
||||
# Go sends only raw bytes...
|
||||
if '[object ArrayBuffer]' == recv.toString()
|
||||
bytes = new Uint8Array recv
|
||||
line = String.fromCharCode.apply(null, bytes)
|
||||
line = line.trim()
|
||||
console.log 'WebRTC --> websocket data: ' + line
|
||||
if DEBUG
|
||||
# Go sends only raw bytes...
|
||||
if '[object ArrayBuffer]' == recv.toString()
|
||||
bytes = new Uint8Array recv
|
||||
line = String.fromCharCode.apply(null, bytes)
|
||||
line = line.trim()
|
||||
console.log 'WebRTC --> websocket data: ' + line
|
||||
@c2rSchedule.push recv
|
||||
@flush()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue