perf: a native, declarative (therefore faster) way to stream data
Right now we manually (with JS) handle each message passed between the bridge and the client: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake-webext/-/blob/4b56f7a350ef78ac2f8888cdd15d529dada30f72/proxypair.js#L227-239 I thought that if there is a way to make the browser do this stuff internally, it'd be faster, both in terms of latency and CPU load. What I image it would look like:
client.streamTo(relay);
relay.streamTo(client);
The closest thing that I found is RTCPeerConnection.addTrack()
. For WebSocket
it appears there's only send
.
Media channels were mentioned in the wiki.
Edited by WofWca