Only console.log the number of bytes, not the literal message.

It doesn't really help to have a bunch TLS application records
interpreted as a string written to the console.
This commit is contained in:
David Fifield 2018-12-04 15:50:54 -07:00
parent aa668bdc92
commit f06104d182

View file

@ -132,21 +132,15 @@ class ProxyPair
# WebRTC --> websocket
onClientToRelayMessage: (msg) =>
line = recv = msg.data
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()
log 'WebRTC --> websocket data: ' + line
@c2rSchedule.push recv
log 'WebRTC --> websocket data: ' + msg.data.byteLength + ' bytes'
@c2rSchedule.push msg.data
@flush()
# websocket --> WebRTC
onRelayToClientMessage: (event) =>
@r2cSchedule.push event.data
# log 'websocket-->WebRTC data: ' + event.data
# log 'websocket --> WebRTC data: ' + event.data.byteLength + ' bytes'
@flush()
onError: (event) =>