Fix some issues with web proxy.
config had some issues handling.
Our compile mode doesn't seem to support properties.
Also stopped overflowing the datachannel when it fills. Stops sending
when it is close to full.
Change-Id: I3628adc8c1fbdaa8a170d5bc892653350f48111c
diff --git a/aos/network/www/proxy.ts b/aos/network/www/proxy.ts
index 9eb0bb6..a675340 100644
--- a/aos/network/www/proxy.ts
+++ b/aos/network/www/proxy.ts
@@ -79,7 +79,7 @@
'message', (e) => this.onWebSocketMessage(e));
}
- get config() {
+ getConfig() {
return this.config_internal;
}
@@ -88,7 +88,7 @@
onDataChannelMessage(e: MessageEvent): void {
const fbBuffer = new flatbuffers.ByteBuffer(new Uint8Array(e.data));
this.configInternal = Configuration.getRootAsConfiguration(fbBuffer);
- for (handler of this.configHandlers) {
+ for (const handler of Array.from(this.configHandlers)) {
handler(this.configInternal);
}
}
@@ -187,7 +187,7 @@
* @param a Finished flatbuffer.Builder containing a Connect message to send.
*/
sendConnectMessage(builder: any) {
- const array = builder.assUint8Array();
+ const array = builder.asUint8Array();
this.dataChannel.send(array.buffer.slice(array.byteOffset));
}
}